PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I recently purchased a social network from a vendor and had it up and running pretty quickly. I immediately begin to encounter errors while attempting to upload photos. I've spent great time trying to track down this issue as all indicators seem to point to the php directives that govern uploading files. The directives that i have modified are listed below with the current values. I have reached out to the vendor who sold me the social network along with the web hosting company, both of which seem to be point the finger back at each other. The hosting company says its an issue with the code in vendor's application and the vendor says its most likely a server setting or an issue with the current version of php I am using. I needed to reach out to neutral party hence the reason for my post here. I have spent hours researching 500 Errors and acertained that they are common errors that could point to many different issues. Any insight into why the photos that range from less the 1M to about 4M are not uploading correctly would be greatly appreciated.
If you have no access to error logs, ask your hosting company to give you such.
It can be apache or PHP error, but in both cases it should be in the logs
If you have .htaccess in the directory you are uploading the photos, or in main directory, please post it as well. Invalid .htaccess can cause the error
Check your PHP version (via phpinfo()) and post it as well;
You can also add
display_error = on
error_reporting = E_ALL
to your configuration, since this will help you find the errors (although it's not good idea on the production server, it's better to enable it temporary while you resolve the issues, then staying with the issues)
I have access to the logs directory but none of the files seem to be a general error log file (they all seem to be related to access, ftp and mail). I created a log file and pointed to it with my directive variable but it does not get updated. Therefore I'm unsure as to which log file I should review in order to find the correct error message.
The upload directory does not have the .htaccess file nor is it in the root folder. should this file be included in both places?
My hosting company suggested that I create an .htaccess file and add it to the root directory, which I did. The contents of the .htaccess file are as follows: AddType x-mapp-php5 .php
After adding that file to my server I now get the following error message:
br /> Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 11264 bytes) in /homepages/5/d282418070/htdocs/include/class_upload.php on line 285