PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > Problem viewing phtml files
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Problem viewing phtml files

Réponse
 
LinkBack Outils de la discussion
Vieux 05/01/2008, 18h49   #1
A.smith
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Problem viewing phtml files

Hi,

I'm having a problem getting .phtml files to display in a web browser. I
can successfully display a test.php page as per PHP install instructions but
the phtml files show up blank (in firefox or IE).

I have added these entries to my apache httpd.conf:

LoadModule php5_module modules/libphp5.so
AddHandler php5-script .php .phtml
AddType text/html .php .phtml
#AddType application/x-httpd-php .php .php3 .php4 .phtml (I tried with this
uncommented too and without the previous entry)
AddType application/x-httpd-php-source .phps

I have the default "recommended" php.ini installed under both:
/usr/local/apache2/conf
/usr/local/apache2/php
as I wasnt certain where it should go...

My system is: Apache/2.2.6 (Unix) PHP/5.2.5


The phtml files are from an opensource product called CDRTool which other
people
are using successfully so I think the most likely problem I have is I have
something
badly configured on my apache/php side (particularly as this isnt something
Ive
attemtped to configure before).
One thing I noticed regarding all of the CDRTool .phtml files is that they
all have a first line like:

<?

Is that normal? I suppose someone who knows php will know what it means :S


Thanks in advance for any advice,

Andy.

________________________________________________
Message sent using UK Grid Webmail 2.7.9
  Réponse avec citation
Vieux 08/01/2008, 10h08   #2
AlexW474
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Problem viewing phtml files

On Jan 5, 7:49 pm, a.sm...@ukgrid.net ("A.smith") wrote:
> Hi,
>
> I'm having a problem getting .phtml files to display in a web browser. I
> can successfully display a test.phppage as perPHPinstall instructions but
> the phtml files show up blank (in firefox or IE).
>
> I have added these entries to myapachehttpd.conf:
>
> LoadModule php5_module modules/libphp5.so
> AddHandler php5-script .php.phtml
> AddType text/html .php.phtml
> #AddType application/x-httpd-php.php.php3 .php4 .phtml (I tried with this
> uncommented too and without the previous entry)
> AddType application/x-httpd-php-source .phps


Try:
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml

I suspect that you do not need to use AddHandler.

>
> I have the default "recommended"php.ini installed under both:
> /usr/local/apache2/conf
> /usr/local/apache2/php
> as I wasnt certain where it should go...
>
> My system is:Apache/2.2.6 (Unix)PHP/5.2.5
>
> The phtml files are from an opensource product called CDRTool which other
> people
> are using successfully so I think the most likely problem I have is I have
> something
> badly configured on myapache/phpside (particularly as this isnt something
> Ive
> attemtped to configure before).
> One thing I noticed regarding all of the CDRTool .phtml files is that they
> all have a first line like:
>
> <?
>
> Is that normal? I suppose someone who knowsphpwill know what it means :S


<? is opens PHP code block. It is normal.
But will PHP process it or not depends on short_open_tag directive
from PHP.ini. it should be On, like:
short_open_tag=On

If short_open_tag=Off, the <?php should be used instead of <?
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 03h00.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,16475 seconds with 10 queries