LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   php default interpretation (https://www.linuxquestions.org/questions/linux-newbie-8/php-default-interpretation-667503/)

TottiGol 09-04-2008 05:22 AM

php default interpretation
 
Hi everybody, i have one problem :
slackware 12/apache 2/php 5


well how to let apache/php recognize automatically some code to be interpretated after the charachers "<?" ?

i will explain better with a simple example...let's have this :

file1.php

<?
echo "ciao";
?>


and this :

file2.php
<?php
echo "ciao";
?>


Well , my problem is the file2.php called from a browser works well printing "ciao".....while file1.php leaves a white page....

The problem is due to the fact that apache/php do not recognize "<?" as a php start characher sequence, isn't it ? what to set to have file1.php working as file2.php ??

Thanks for giving some help.

bathory 09-04-2008 06:08 AM

You should edit the following in php.ini:
Code:

short_open_tag = On
and restart apache.
Mind that according to php documentation:
Quote:

NOTE: Using short tags should be avoided when developing applications or
libraries that are meant for redistribution, or deployment on PHP
servers which are not under your control, because short tags may not
be supported on the target server. For portable, redistributable code,
be sure not to use short tags.
it's not advisable to do so.

Regards

TottiGol 09-04-2008 11:11 AM

Quote:

Originally Posted by bathory (Post 3269303)
You should edit the following in php.ini:
Code:

short_open_tag = On
and restart apache.
Mind that according to php documentation:
it's not advisable to do so.

Regards

Well thanks for the answer...

you know what....i've need this change to let PhpOpenChat (a free ...PORTABLE chat) work under my box......


All times are GMT -5. The time now is 07:12 PM.