Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Friday, 20 June 2014

PHP Upload Limits on GoDaddy PHP5.ini


I developed a health and safety document management website which has been running without a hitch for around a month now. I had intentionally set file size limits to be 10MB and decided I would increase this limit as and when larger documents appear. Today a user was hitting an error with a 17MB document. I made all the changes necessary to my source code and put the change live, only for the user to report back that they received an error. Straight away I tried a 12MB document and it worked, I asked how big the file the user was trying and they told me 17MB. I did some research on the error message.

Fatal error: Allowed memory size of 67108864 bytes exhausted”

A lot of results for that error message. I managed to find some tutorials on how to resolve the issue on GoDaddy. Unfortunately the information I found is outdated (or at least no longer applicable to hosting package I am on)

The articles suggest creating a php5.ini on the root directory adding the following configuration:

file_uploads = On
post_max_size = 128M
upload_max_filesize = 128M
memory_limit = 128M


However after speaking with GoDaddy support this is no longer correct (at least not for those on the Economy Linux Hosting with cPanel package)


To resolve the issue you must create a .users.ini file. 

Thursday, 10 April 2014

GoDaddy PHPMailer Relay problems

This has been very frustrating, if you search for GoDaddy and PHPMailer you'll find loads of posts about how PHPMailer needs to be configured in order to work with GoDaddy's hosting.

I tried using some of the configuration information I found online but I wasn’t having any luck. I kept getting “Error: The following From address failed:” despite trying several different addresses (including valid addresses that I had setup on GoDaddy’s cPanel)

I finally came across Aravind is Online blog which nudged me in the right direction (http://aravindisonline.blogspot.co.uk/2012/01/phpmailer-with-godaddy-smtp-email.html)

For completeness.
You cannot use an external host to relay email messages. You must use the following host: relay-hosting.secureserver.net  

I setup a mail user specifically for PHPMailer (I am hosting a subdomain so all my email services are elsewhere)

Use PORT 25 (numerous guides suggest 465)


Set SMTP Auth to true, Aravind’s guide suggests to set this to false, however this didn’t work for me.