PHP and Server Settings
Posted 04th Oktober, 2018
Every web server can be set up differently, and expect code to work in certain ways. If there is an error, at it’s most obvious, a web server may not have the ability to process the language you have uploaded. Slightly more complex, you may be missing an individual module, or running an out of date version of a specific module.
Lots of the errors you will encounter (white screens of death, timeouts, images not loading) can all be due to a server configuration issue. We are experienced in fixing a lot of these, but many common issues are listed below, or on the specific application outlines:
- Timeout Issues
- Memory Limit Exceeded
- Deprecated
- The PHP file download rather than being processed as PHP
- PHP file is read as plain text
- See Wordpress white screen of death.
Also see:
Logging PHP Errors
You can check your PHP error log as follows:
- Connect over ssh to your server
- run
tail /var/log/apache2/error.log
in order to see the most recent issues. I
if you do not have access to that file and/or are running on a different type of environment you can easily enable error logging by editing your php.ini file and adding the following:
error_log = /absolute_path_to_your_directory_/php-scripts.log
and then navigate to that file and use tail php-scripts.log
Increasing your memory limit and execution time
The fix here lies in simply increasing your php memory limit. Step here:
- Connect over ssh to your server
- Locate your php.ini file and increase the
memory_limit
andmax_execution_time
within this file.
If you are unable to locate your php.ini file you can always create a file called phpinfo.php and add the following within it <?php phpinfo();
and load the file from your domain such as : yoursite/phpinfo.php to find the path to php.ini