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:
# vi php.ini
Set short_open_tag to On:
short_open_tag = On
Save and close the file. Restart webserver:
# service httpd restart
OR
# /usr/local/etc/rc.d/apache22 restart
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop














{ 7 comments… read them below or add one }
Hi Vivek,
You have a typo mistake at the following line:
# /usr/local/etc/rc.d/apache22 restart
I think it should be:
# /usr/local/etc/rc.d/apache2 restart
regards,
B!n@ry,
Apache22 is for Apache version 2.2 under FreeBSD.
HTH
Don’t you have a typo here :
“You need to all the “You need to allow” ?
Peko,
The post has been updated.
I appreciate your post.
Aha, didn’t know that Vivek, thanks for the info :)
Hello,
Please help
This is what gives me your component on the screen when I apply it with joomla 1.5.23
pgtitle?> nbr_selection_fields) {?> nbr_selection_fields){ case 1: ?> title1 ?> sf1 ); $i vertical){// disposicao vertical ?> title1 ?> sf1 ); $i title2 ?> title1 ?> title2 ?> sf1 ); $i vertical){// disposicao vertical ?> title1 ?> sf1 ); $i title2 ?> title3 ?> title1 ?> title2 ?> title3 ?> sf1 ); $i vertical){// disposicao vertical ?> title1 ?> sf1 ); $i title2 ?> title3 ?> title4 ?> title1 ?> title2 ?> title3 ?> title4 ?> sf1 ); $i Button "view document" show_downloads) echo JText::_('Downloads: ').$this->download_count;?> '.JText::_('This Document Type does not exist!').' ('.JText::_('Probably recently deleted').')' ; }?>Well how about that… I stopped using Apache2 predominantly a long time ago except maintenance for clients and had been using lighttpd since. Regardless, I never use PHP’s short opening tag but whether someone added it into what was mainly my code or I thought I’d be really tricky/lazy, one occurrence in one script was giving me 500′s claiming mis-matched loops-brackets.
I didn’t know something so simple could cause so much frustration…thanks for the post!!! Now I know, I’ll hit anyone that I see who thinks the three-letter acronym (of the language they use to make a living) is too much to type…