![]() |
PHP Tags Issue..
Hi Experts,
I have just started learning PHP today, and my initial task is to port a PHP application from a Production Linux Box to a development Windows Box. I was able to install and configure apache, php and mysql. The application is up and running, but some of the actual code start appearing in the PHP page in the browser. :-/ I was wondering if there was a difference between the PHP parser in windows and linux.. From my initial troubleshooting it seems to be something to do with tags.. Please suggest... |
Experts? We is experts! :-)
It may be the case that your PHP is configured to not support short PHP tags -- the <? ones. The standard PHP tag is <?php, however, many people will still add <? to their code thinking that is the standard.Try the following 2 lines of code and see what occurs: |
Hi WildHoney..
The <?php works fine, but the <? doesn't .... |
I looked up php.ini file and found this "short_open_tag=off"
I changed it to "on". But the issue still persists... |
Could there be anything specific to the OS..?:-/
|
Did you restart the server after you changed the .ini? It would need to be restarted in order to reload the settings (and in turn pick up your new settings).
|
P.S. This might help if you need to restart Apache
http://www.informit.com/articles/art...26130&seqNum=5 |
There was no effect even after restarting apache. However replacing some <? tags with <?php tags did the trick..
|
It sounds to me like you either haven't edited the PHP.ini correctly or you haven't edited the correct file.
Create a new file with php Code:
|
Then maybe check any .htaccess files to see if they are blocking the short tag. It may also be that your "short_open_tag=off" has a ";" before it (commenting it out).
|
| All times are GMT. The time now is 08:23 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0