I had a problem on one of my wordpress blogs where a user wanted to upload a file larger than 2MB. When attempting to upload, he got the error message:

The uploaded file exceeds the upload_max_filesize directive in php.ini.

The solution was to simply change the upload_max_filesize parameter in the php.ini file. But, after searching, I found that there wasn’t a php.ini file on the computer in question. I created a new one and tried it in /etc, /var/php5/etc and some other locations, but the change wasn’t registered. Finally I remembered that I could use php itself to tell me where it expected the file. To do this, I created a simple file, called phpinfo.php and put in the following info:

<? phpinfo(); ?>

Then, when I looked at that file in a browser, it showed that the location of the php.ini file should be /var/php5/lib.