Fixing WordPress Plugin Error
December 19, 2024 · AI Conversations
erro when adding plugin by wp-admin
### Steps to Fix:
1. **Increase PHP Limits in the `php.ini` File**
Locate and edit the `php.ini` file used by your WordPress server. Add or modify the following lines:
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
Adjust the values (`64M` and `300`) as needed for your setup.
After making changes, restart the web server:
sudo service apache2 restart # For Apache
sudo service nginx restart # For Nginx
2. **Modify `.htaccess` File**
If you don’t have access to `php.ini`, add the following to your WordPress `.htaccess` file:
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
3. **Adjust via `wp-config.php`**
Add the following code to your `wp-config.php` file if you can't modify the server files directly:
@ini_set('upload_max_filesize', '64M');
@ini_set('post_max_size', '64M');
@ini_set('max_execution_time', '300');
4. **Update Settings in cPanel**
If your hosting provider uses cPanel:
– Log in to cPanel.
– Navigate to **Select PHP Version** or **MultiPHP INI Editor**.
– Update the **upload_max_filesize**, **post_max_size**, and **max_execution_time** values.
5. **Use FTP to Upload the Plugin**
If the above methods don't work or you cannot modify server settings:
– Upload the plugin manually via FTP to the `/wp-content/plugins` directory.
– Go to `wp-admin > Plugins` and activate the plugin.
Let me know if you encounter any issues during these steps!