Understanding File Upload Limits
File uploads in CloudOnex Business Suite are subject to several PHP configuration limits that may need to be adjusted depending on your needs:
-
upload_max_filesize
: Maximum size of individual uploaded files -
post_max_size
: Maximum size of POST data (should be larger than upload_max_filesize) -
memory_limit
: Maximum memory a script can consume -
max_execution_time
: Maximum time in seconds a script can run
Adjusting Limits in cPanel & Shared Hosting
If your hosting uses cPanel, you can easily modify PHP settings:
- Log in to your cPanel account
- Navigate to Software → Select PHP Version or MultiPHP INI Editor
- Select your domain if prompted
- Look for the following directives and adjust their values:
upload_max_filesize = 64M post_max_size = 64M memory_limit = 256M max_execution_time = 300
- Click Apply Changes or Save
For VPS or Cloud Server: Modifying PHP.ini Settings
If you have direct access to your server's PHP configuration:
-
Locate your
php.ini
file (common locations):- Linux:
/etc/php.ini
or/etc/php/[version]/apache2/php.ini
- Windows:
C:\php\php.ini
- Linux:
-
Add or modify these lines:
; Increase file upload size limit to 64MB upload_max_filesize = 64M ; Increase POST size limit to 64MB (should be equal or larger than upload_max_filesize) post_max_size = 64M ; Increase memory limit to 256MB memory_limit = 256M ; Increase max execution time to 5 minutes max_execution_time = 300
-
Save the file and restart your web server:
# Apache on Linux sudo service apache2 restart # Nginx on Linux sudo service nginx restart # XAMPP on Windows restart Apache from XAMPP Control Panel
Using .htaccess Method
If you don't have access to php.ini
or cPanel, you can try using .htaccess
:
- Create or edit
.htaccess
in your website's root directory - Add these lines:
php_value upload_max_filesize 64M php_value post_max_size 64M php_value memory_limit 256M php_value max_execution_time 300
Using ini_set() Method
In some cases, you might need to set these values programmatically:
ini_set('upload_max_filesize', '64M');
ini_set('post_max_size', '64M');
ini_set('memory_limit', '256M');
ini_set('max_execution_time', 300);
Note: Some settings cannot be changed using ini_set()
and must be set in php.ini
or through server configuration.
Verifying Changes
To verify your changes have taken effect:
- Create a PHP info file:
<?php phpinfo(); ?>
- Upload it to your server as
info.php
- Access it through your browser
- Search for the directives you modified
- Important: Delete this file after verification for security reasons
Common Issues and Solutions
-
Changes Not Taking Effect:
- Ensure you're editing the correct
php.ini
file - Restart your web server after changes
- Check if your hosting provider allows these changes
- Ensure you're editing the correct
-
Server Restrictions:
- Some hosting providers may have hard limits
- Contact your hosting provider for assistance
- Consider upgrading your hosting plan if needed
-
Memory Errors During Upload:
- Increase both
memory_limit
andmax_execution_time
- Consider optimizing file sizes before upload
- Implement chunked file uploads for very large files
- Increase both