|
2.1.3 - Upload Configuration |
Top Previous Next |
|
PHP.INI Configuration
Default installation of PHP comes with file upload enabled, but some vendors have disabled file upload for security reasons. Also, by default PHP has a LIMIT of 2 MB in upload and 8 MB in post size, changes are necessary.
Look for PHP.INI: /usr/local/apache/php/php.ini (Redhat) or /usr/local/lib/php.ini (Solaris) or /usr/local/etc/php.ini (Freebsd)
If you cannot find it, use one of the following methods: 1. Use phpinfo( ) in your PHP (see the Section 1- Prerequisites), find out where your PHP.INI is. 2. Use unix command to search for it: login> find / -name "php.ini" -type f
Now, check the variables in your PHP.INI:
file_uploads=On upload_tmp_dir = /tmp upload_max_filesize=100M post_max_size=100M
upload_tmp_dir can be any directories, but make sure the proper write permission is set.
The above example has set the limit to 100 MB (default is 2 MB upload and 8 MB post size). Do not set it too big unless it is necessary.
YOU MAY HAVE TO RESTART APACHE to see the changes
For details about the configuration, refers to http://www.php.net/
Permission Settings
The "upload" directory receives the file and writes to the hard drive, ensure it has the right permission. We set to "Everyone" in general, you should tweak your security setting when deploying to the live server, you are responsible for your servers security.
login> chmod a+rxw upload
Upload Testing
Option A:
If you have launched the SpeedCheck Pro main page, you can click on the "Manual File Upload" link. http://speedcheck.yourserver.com/SpeedCheck.php
Option B:
Open the page directly in your browser: http://speedcheck.yourserver.com/SpeedCheck_manual_upload.html
Upload testing:
Now, you should see this:
To test if your server supports UPLOAD, click on "Manual Upload" link.
If you see "Upload successful", your PHP is ready for upstream test.
Since "Delete File Automatically" is disabled by default, at this stage you should see your /upload folder and the file you just uploaded should be there. It is being renamed to be a text file for security reason.
Force Upload
In Version 5.5 and above, we introduced a feature called "Force Upload". The speed testing will continue to send data to the server even the server rejects the data (upload size limit setup on the server). To enable this feature, set Applet parameter to "1":
<param name="force_upload" value="1">
If this is enabled, and the upload data size is larger than your server limit, you will expect (1) To see error in your web server log (2) Physical file will NOT be written to the hard drive
Troubleshooting
Please refer to Troubleshooting section.
|