Jump to content

File Uploading


Recommended Posts

Hi,

 

I receive an Error code 1 when I try upload a file. Now I know, from php.net/manual/, that this error is thrown when the file size of the uploaded file exceeds the upload_max_filesize directive specified in php.ini. I went over to Webmin -> Others -> PHP Configuration and specified the max upload size to be 10MB (upload_max_filesize = 10M) and changed, for good measure the post_max_size to 10MB as well.

 

Restarted the server and retried uploading a 2.5MB file, and it still throws an error 1.

 

Am I missing something?

Link to comment
Share on other sites

Okay, under phpinfo() it says local and master values are 2M.

 

Really don't know why. I have them set to 10M in 3 locations:

 

/etc/php5/cgi/php.ini

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 10M

 

/etc/php5/cli/php.ini

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 10M

 

/etc/php5/apache/php.ini

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 10M

Link to comment
Share on other sites

The only time I have seen it where the correct php.ini is being used and the syntax of the statement is correct (and you have restarted the web server to get any changes made to the master php.ini to take effect, assuming that is the master php.ini and not a local one) but a setting doesn't work is if there is a syntax error earlier in the php.ini file.

 

Do any changes you make to that php.ini show up in the phpinfo() output? Try putting a setting right at the start of the php.ini to see if it takes effect. Any chance you have edited the php.ini using a Windows program and it got renamed as php.ini.txt?

Link to comment
Share on other sites

Could be a permission problem. Perhaps the php.ini file is owned by a different user than the web server is running under and the permissions are not set so that the web server/php can read the file.

 

Are they are relevant messages in the web server error log file?

 

Where is this server at? Perhaps the web host knows something as to why the php.ini cannot be read.

 

In the mean time, you can also put those settings in to a .htaccess file (when php is running as an Apache Module and the web server has been configured to allow settings to be changed in a .htaccess file) or in a local php.ini (when php is running as a GCI application.)

Link to comment
Share on other sites

OMW... I should really rather use putty than webmin...

 

I found my mistake. The php.ini file loaded was in the apache2 folder. Webmin kept loading the apache php.ini file so it never changed.

 

It reflects what i want it to reflect now so it's good. PFfft, that'll teach me. ::)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.