Overview
In some hosting environments (Apache-based servers), you can adjust PHP settings directly via the .htaccess file. This is useful for increasing limits such as execution time or memory without accessing server configuration tools.
Common settings you may need to modify include:
php_value max_execution_timephp_value memory_limitphp_value upload_max_filesizephp_value post_max_size
Rocket.net allows you to view and edit your website files, including .htaccess, directly from the File Manager in the Rocket dashboard.
What .htaccess Is Used For on Rocket.net
On Rocket.net, .htaccess is mainly used for:
- WordPress rewrite rules
- Redirects
- Security rules (block or restrict acces)
How to Update PHP Settings via .htaccess
- Log in to your Rocket.net dashboard
- Go to Sites
- Select your site
-
Click File Manager
-
Open the
public_htmldirectory and locate and click.htaccess - Edit and save changes
Step 2: Add your PHP directives
Insert the following lines into your .htaccess file:
# Increase PHP execution time
php_value max_execution_time 300
# Increase memory limit
php_value memory_limit 256M
# Allow larger uploads
php_value upload_max_filesize 64M
# Increase POST size limit
php_value post_max_size 64M
Important ordering rule
post_max_size must be equal or larger than upload_max_filesize, otherwise uploads will still fail.
Step 3: Save and test your site
After saving:
- Refresh your website
- Retry the action that previously failed (upload, import, etc.)
Common Values Explained
| Setting | Purpose | Example Value |
|---|---|---|
| max_execution_time | Script timeout limit | 300 |
| memory_limit | PHP memory usage limit | 256M |
| upload_max_filesize | Max file upload size | 64M |
| post_max_size | Max POST request size | 64M |
These are the most frequently adjusted PHP values:
-
max_execution_time→ Prevents scripts from timing out during long processes -
memory_limit→ Controls how much memory PHP can use -
upload_max_filesize→ Maximum file upload size -
post_max_size→ Maximum size of POST requests
Best Practice Notes
- Only increase limits when necessary
- Keep values reasonable to avoid performance issues
Still having issues uploading or getting timeout errors? Drop us a line in live chat or Submit a Ticket to our Support Team, and our team will get it fixed for you.
Comments
0 comments
Article is closed for comments.