Page 1 of 2
Code works in Development but not Production
Posted: Thu Jun 19, 2008 9:19 am
by James0816
I am in a quandry here.
I have developed an Intranet application for my work place. I am using my machine as my development machine. I have an identical machine for production.
On the dev side of things everything works perfectly. I copied the code from the dev machine to production. For some reason, on the production side of things, my uploading of files is not working for .tif files. I can upload every kind of other files and to different folders, just not these files. And they are relatively small at max of 2.5mb. It works fine from my (dev) machine. I have checked the source code for any possible machine dependant code (all the same), I have checked the PHP.ini file on both machines...all the same.
I'm not sure if this is enough to go by to help, but I could really use some to figure it out.
Can anyone possible shed a little light on this for me? I will glady supply as much information as I possibly can.
Thank you very much!

Re: Code works in Development but not Production
Posted: Thu Jun 19, 2008 9:28 am
by nowaydown1
Hey James,
I know you said that you checked the php.ini and they are identical, but I would just take one more look at the configuration in your production environment, specifically these two directives:
upload_max_filesize (
http://php.net/ini.core#ini.upload-max-filesize)
post_max_size (
http://php.net/ini.core#ini.post-max-size)
PHP deafults to 2MB for file uploads. Set them both to an adjusted value (like 8M, actually post_max_size should be slightly larger than whatever you set upload_max_filesize to, check the docs) or whatever you feel is reasonable to get the job done. Let me know how it goes.
Also, try to check the values using phpinfo(); to make sure your adjustments are being reflected correctly.
Re: Code works in Development but not Production
Posted: Thu Jun 19, 2008 9:57 am
by James0816
Interesting ..... very interesting indeed.
I just check the PHP.ini on both machines:
post_max_size = 8M
upload_max_filesize = 10M
after reading your post, I went back to the production environment to test uploading of any file over 2mb. Did not work. Anything under 2MB, I was able to upload just fine.
There must be another setting somewhere that I missed on the production side.
Re: Code works in Development but not Production
Posted: Thu Jun 19, 2008 10:03 am
by nowaydown1
Can you describe the behavior that you see on your production server? What exactly happens when you try to upload? Also, did your phpinfo() dump show the same as what you have set in your php.ini?
Re: Code works in Development but not Production
Posted: Thu Jun 19, 2008 10:18 am
by James0816
phpinfo does show the 8 and 10 mb respectively.
what happens is...when i try to upload a file that is over 2mb...the status bar at the bottom of the browswer keeps going and then i eventually get a blank browser window saying done.
files less than 2mb, it zips right though.
Re: Code works in Development but not Production
Posted: Thu Jun 19, 2008 10:26 am
by nowaydown1
Thanks for the additional info. Do you have display_errors enabled in your php.ini file? You might also try checking your max_input_time directive to see what that's set to (
http://us3.php.net/manual/en/info.confi ... input-time).
How long does it take for your 2MB file to upload? Have you tried checking your webserver logs to see if PHP is complaining about anything? The blank page bit seems like the PHP engine is giving up at some point. If it was a filesize issue I would expect it to just dump you back on your form.
Re: Code works in Development but not Production
Posted: Thu Jun 19, 2008 10:33 am
by James0816
max_execution_time = 30
max_input_time = 60
memory_limit = 8M
Not sure on the log files. Where would I check for them?
Re: Code works in Development but not Production
Posted: Thu Jun 19, 2008 10:37 am
by nowaydown1
Where your log files are kept will depend on what OS/Webserver you are using. If it's a linux box and you run apache, I would suspect /var/log/apache2, for windows I'm not sure. Was display_errors turned on already then?
Re: Code works in Development but not Production
Posted: Thu Jun 19, 2008 10:57 am
by James0816
it was set to off. I changed it to ON as well set the log file to this:
error_log = c:/phplogfile.txt
do i have to reset the machine to re-initialize the php.ini file?
Re: Code works in Development but not Production
Posted: Thu Jun 19, 2008 11:01 am
by nowaydown1
Unless you're running PHP as a cgi, then yes, the web server will need to be restarted. After restarting, try to upload your file again with display_errors on and see if it gives you any errors.
Re: Code works in Development but not Production
Posted: Thu Jun 19, 2008 11:29 am
by Benjamin
First thing I would verify is that the upload folder is writable guys.
EDIT: Missed the part about other file types working, ignore me.
Re: Code works in Development but not Production
Posted: Thu Jun 19, 2008 11:37 am
by James0816
Findings in log file:
[19-Jun-2008 12:33:28] PHP Fatal error: Maximum execution time of 60 seconds exceeded in
This is interesting because if I am interpretting this correctly, my php.ini file has the following value:
max_execution_time = 30
Why would it say 60 if it is supposed to be set to 30?
Re: Code works in Development but not Production
Posted: Thu Jun 19, 2008 12:01 pm
by nowaydown1
I -think- it's because max_execution_time and max_input_time get rolled up into the same thing. Just try cranking up the values and see if you still have the issue.
Re: Code works in Development but not Production
Posted: Thu Jun 19, 2008 12:04 pm
by James0816
I just tried the following values and got the same 60 second time out error:
max_execution_time = 180
max_input_time = 360
Re: Code works in Development but not Production
Posted: Thu Jun 19, 2008 12:10 pm
by nowaydown1
Sounds like for whatever reason your php.ini changes aren't being picked up. Try to dump phpinfo() again and see if it's still showing 60. I'm really in the dark when it comes to Windows configuration stuff. Maybe one of the other guys can chime in here.