The error proc_open() has been disabled for security reasons occurs when the proc_open function is disabled in PHP for security reasons. Some hosting providers disable it to prevent command execution vulnerabilities.
What is the proc_open() Error
The proc_open() function is used to execute external processes from PHP scripts. It may be disabled by hosting providers in the following cases:
- Shared hosting for enhanced security
- Servers with strict security policies
- Preventing arbitrary command execution
Check if proc_open Is Disabled
Execute this command to see disabled PHP functions:
Expected output (if proc_open is disabled):
If proc_open appears in the list, it means PHP is blocking this function.
Enable proc_open() in php.ini
1. Find the php.ini File
Execute the command:
Example output:
The path to your php.ini file may differ depending on the server configuration.
2. Edit php.ini
Open the file in a text editor:
Find this line:
Remove proc_open and proc_close if they are listed:
Save and exit (CTRL + X, then Y, then Enter).
3. Restart Apache or PHP-FPM
For Apache:
For Nginx with PHP-FPM:
sudo systemctl restart nginx
Now proc_open() should work!
Verify That proc_open() Is Enabled
Execute:
Expected output (if proc_open is enabled):
If proc_open is absent from the list, it's enabled!
Alternative: Enable proc_open() in .user.ini (Shared Hosting)
If you don't have root access, try adding this to the .user.ini file in the root folder of your site:
This will override the default server settings (if your hosting provider allows it).
.user.ini file only works if the user_ini.filename directive is enabled in PHP.
Troubleshooting
| Problem | Solution |
|---|---|
| Still getting proc_open() error | Make sure you edited the correct php.ini file (cli, apache2, or fpm). Check the configuration for your PHP version. |
| Shared hosting doesn't allow changes | Contact your hosting provider and request enabling proc_open. Specify a specific reason, such as Composer operation. |
| Web server won't restart | Use sudo systemctl restart php8.1-fpm apache2 to restart PHP and Apache simultaneously. |
| Changes not taking effect | Check that you restarted the correct service. For PHP-FPM use sudo systemctl restart php8.1-fpm. |
Summary
| Task | Command/Action |
|---|---|
Check if proc_open() is disabled |
php -r "echo ini_get('disable_functions');" |
| Find php.ini file | php --ini |
Enable proc_open() in php.ini |
Remove proc_open from disable_functions |
| Restart server | sudo systemctl restart apache2 or php-fpm |
| Verify fix | Execute php -r "echo ini_get('disable_functions');" |
Now proc_open() should be enabled and working correctly!


