
Here’s a list of things you can check if you aren’t getting anything written to the PHP error log on your server:
- In
php.ini
, do you have error_reporting set toE_ALL
? - In
php.ini
, do you havelog_errors
enabled? - In
php.ini
, do you havetrack_errors
enabled? - Have you specified a valid file / location for
error_log
- Does the user that starts PHP (e.g apache) have relevant permissions and ownership to write to the PHP
error_log
file ? - Does your application have an override set in
.htaccess
orphp.ini
for any of the above? - Have you restarted PHP/Apache after making changes for these things to take effect?
- What does
php -i | grep error
tell you regarding these settings?

By default on Apache web servers, PHP code will not execute in a file that does not have a .php
(or similar) extension. So even though you can embed PHP into a HTML file, it won’t execute when the file extension is .html
, .htm
etc.
To change this, you can add a .htaccess
file to allow PHP execution.
Here are some examples depending on your system:
AddType application/x-httpd-php .html .htm
For certain hosting providers you may need to do this (adjust for PHP version too).
Addhandler application/x-httpd-php5 .html .php
Put this in a file called .htaccess
in the same folder as your HTML files.

For example, on a Mac, you’ll often find .DS_Store
files. To find and remove these you can run the following command to search for and remove every instance:
$ find . -type f -name ".DS_Store" -exec rm {} ;
This will find all files (-type f
) called .DS_Store
and execute the rm
(remove) command on that set {}
.
Run from the top directory and it will recurse its way into all sub directories and remove the files. This can be a dangerous command so use with caution.
You can also adapt the command to execute something else (e.g. a mv
to another location for example.