Control PHP Error Logging From .htaccess
Here’s a great article: http://perishablepress.com/advanced-php-error-handling-via-htaccess/ It covers all the different options for PHP logging from .htaccess.
Here’s a great article: http://perishablepress.com/advanced-php-error-handling-via-htaccess/ It covers all the different options for PHP logging from .htaccess.
It’s easy to upgrade between PHP version is you’re using the IUS repository: http://iuscommunity.org Start by determining which version and modules you have already installed:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
[root@acme ~]# yum list | grep php | grep installed php52.x86_64 5.2.17-1.ius.el5 installed php52-bcmath.x86_64 5.2.17-1.ius.el5 installed php52-cli.x86_64 5.2.17-1.ius.el5 installed php52-common.x86_64 5.2.17-1.ius.el5 installed php52-devel.x86_64 5.2.17-1.ius.el5 installed php52-gd.x86_64 5.2.17-1.ius.el5 installed php52-imap.x86_64 5.2.17-1.ius.el5 installed php52-ioncube-loader.x86_64 4.0.8-1.ius.el5 installed php52-ioncube-loader-debuginfo.x86_64 4.0.8-1.ius.el5 installed php52-ldap.x86_64 5.2.17-1.ius.el5 installed php52-mbstring.x86_64 5.2.17-1.ius.el5 installed php52-mysql.x86_64 5.2.17-1.ius.el5 installed php52-ncurses.x86_64 5.2.17-1.ius.el5 installed php52-pdo.x86_64 5.2.17-1.ius.el5 installed php52-pear.noarch 1:1.9.2-1.ius.el5 installed php52-xml.x86_64 5.2.17-1.ius.el5 installed php52-xmlrpc.x86_64 5.2.17-1.ius.el5 installed |
So in this case we have the “php52” packages. Next decide which package set
For a server using Plesk add the following lines to a .htaccess file to stop execution of PHP scripts in the folder:
|
1 2 3 4 5 |
RemoveHandler .php .phtml .php3 RemoveType .php .phtml .php3 php_flag engine off |
I like to use this to protect cache and image upload folders that are writable by the
Here’s a basic loop in Bash:
|
1 2 3 4 5 6 7 8 |
SERVERS="s1 s2 s3 s4" for S in $SERVERS do echo "Server: $S" # ... do something ... done |
Notice that it iterates over a space delimited string of values. If you have a comma delimited list then you can do something like this:
|
1 2 3 4 5 6 7 8 9 10 11 |
SERVERS="s1,s2,s3,s4" OLDIFS=$IFS IFS=',' for S in $SERVERS do echo "Server: $S" # ... do something ... done IFS=$OLDIFS |
IFS is the “internal field separator” which
There are two common causes to this error: 1. You have an actual syntax error in you code that needs to be fixed. 2. Your code is expecting the PHP “short_open_tags” setting to be turned on and it is not.
Reliable Penguin provides managed web hosting, systems administration, website and server migrations, and expert consulting.
Submit the form—or for immediate service call 866-649-7984.