Author Topic: PHP Not Accepting Tag; Only Accepting php and Tag  (Read 7767 times)

Offline admin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 296
    • View Profile
PHP Not Accepting Tag; Only Accepting php and Tag
« on: January 30, 2012, 02:29:09 AM »
Q. I'm using PHP along with latest version of Apache. Only <?php and <script> tags are recognized. Many of my scripts are broken. How do I allow the <? tag also?


A. You need to allow the <? tag by editing php.ini file. 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.

Open php.ini ( /etc/php.ini or /usr/local/etc/php.ini), enter:
Code: [Select]
# vi php.iniSet short_open_tag to On:
Code: [Select]
short_open_tag = OnSave and close the file. Restart webserver:
Code: [Select]
# service httpd restartOR
Code: [Select]
# /usr/local/etc/rc.d/apache22 restart