PHP 5.3 Common Issues and Solutions
These issues can appear when you're upgrading older scripts to run in a PHP 5.3 based environment or if you have custom php.ini files under your account that aren't PHP 5.3 ready.
Symptom: 500 Internal Server Error
Symptom: "The encoded file has format major ID 1, whereas the Loader expects 4"
If you use custom php.ini files for your site you will most likely have to make at least some of the following adjustments.
Suppress PHP Warnings
If you're getting new PHP warning messages you'll need to change your error_reporting setting in the php.ini file. To do this add the following line to your custom php.ini file:
You will also need to ensure any other "error_reporting" lines are removed or commented out (using the ; character)
Fix Date.Timezone error messages
If you are on a US Shared Server you'll need to add the following to your custom php.ini file:
If you're on a UK Shared Server you'll need to add the following to your custom php.ini file:
Switch Loader Versions
If your custom php.ini file has any loader extensions defined their paths will need to be updated.
Zend Loader / Zend Guard:
The following line should be removed from your custom php.ini file:
The following line should be added to your custom php.ini file:
Ioncube Loader:
The following line should be removed from your custom php.ini file:
The following line should be added to your custom php.ini file:
PDO / PDO MySQL:
The following lines should be added your custom php.ini file:
Magic Quotes:
The following lines should be added your custom php.ini file:
These issues can appear when you're upgrading older scripts to run in a PHP 5.3 based environment or if you have custom php.ini files under your account that aren't PHP 5.3 ready.
Symptom: 500 Internal Server Error
- Ensure your public_html directory permissions are properly set to 750 using your FTP or SSH client, or using the CPanel File Manager.
- For all content within your public_html directory ensure your files permissions are set to 644 and directory permissions are set to 755 using your FTP or SSH client.
- Ensure your script(s) and any installed extensions or plugins are up-to-date.
- Check for custom php.ini files under your account. See "php.ini Changes" below if applicable.
- Ensure your script(s) and any installed extensions or plugins are up-to-date.
- Check for custom php.ini files under your account. See "php.ini Changes" below if applicable
- Check for custom php.ini files under your account. See "php.ini Changes" below if applicable.
- Check for custom php.ini files under your account. See "php.ini Changes" below if applicable.
- Create a custom php.ini file with the following:
zend_extension="/usr/local/IonCube/ioncube_loader_lin_5.3_new.so"
Symptom: "The encoded file has format major ID 1, whereas the Loader expects 4"
- You will need to obtain and install an updated copy of the script in question that has been encoded for use under PHP 5.3. Alternatively, if the script's developer provides an IonCube encoded version you may install that.
If you use custom php.ini files for your site you will most likely have to make at least some of the following adjustments.
Suppress PHP Warnings
If you're getting new PHP warning messages you'll need to change your error_reporting setting in the php.ini file. To do this add the following line to your custom php.ini file:
error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
You will also need to ensure any other "error_reporting" lines are removed or commented out (using the ; character)
Fix Date.Timezone error messages
If you are on a US Shared Server you'll need to add the following to your custom php.ini file:
date.timezone="America/Chicago"
If you're on a UK Shared Server you'll need to add the following to your custom php.ini file:
date.timezone="UTC"
Switch Loader Versions
If your custom php.ini file has any loader extensions defined their paths will need to be updated.
Zend Loader / Zend Guard:
The following line should be removed from your custom php.ini file:
zend_extension="/usr/local/Zend/lib/Optimizer-3.3.9/php-5.2.x/ZendOptimizer.so"
The following line should be added to your custom php.ini file:
zend_extension="/usr/local/Zend/lib/Guard-5.5.0/php-5.3.x/ZendGuardLoader.so"
Ioncube Loader:
The following line should be removed from your custom php.ini file:
zend_extension="/usr/local/IonCube/ioncube_loader_lin_5.2.so"
The following line should be added to your custom php.ini file:
zend_extension="/usr/local/IonCube/ioncube_loader_lin_5.3.so"
PDO / PDO MySQL:
The following lines should be added your custom php.ini file:
extension=pdo.so
extension=pdo_mysql.so
Magic Quotes:
The following lines should be added your custom php.ini file:
magic_quotes_gpc=Off
magic_quotes_runtime=Off