versionpress / versionpress

Git-based version control for WordPress. Whoa!
https://versionpress.com/
2.6k stars 238 forks source link

Problems with activation when proc_open disabled #1244

Open pavelevap opened 7 years ago

pavelevap commented 7 years ago

First mention: https://github.com/versionpress/support/issues/98#issuecomment-310034199

I was able to reproduce and ended with following error:

Fatal error: Uncaught exception 'Symfony\Component\Process\Exception\RuntimeException' with message 'The Process class relies on proc_open, which is not available on your PHP installation.' in C:\www\wordpress48\wp-content\plugins\versionpress\vendor\symfony\process\Symfony\Component\Process\Process.php:144 

Stack trace:
#0 C:\www\wordpress48\wp-content\plugins\versionpress\src\Utils\Process.php(23): Symfony\Component\Process\Process->__construct('echo test > "C:...', NULL, NULL, NULL, 3600, Array) 
#1 C:\www\wordpress48\wp-content\plugins\versionpress\src\Utils\RequirementsChecker.php(261): VersionPress\Utils\Process->__construct('echo test > "C:...')
#2 C:\www\wordpress48\wp-content\plugins\versionpress\src\Utils\RequirementsChecker.php(110): VersionPress\Utils\RequirementsChecker->tryWrite()
#3 C:\www\wordpress48\wp-content\plugins\versionpress\admin\inc\activationPanel.php(51): VersionPress\Utils\RequirementsChecker->__construct(Object(VersionPress\Database\Database), Object(VersionPress\Database\DbSchemaInfo))
#4 C:\ww in C:\www\wordpress48\wp-content\plugins\versionpress\vendor\symfony\process\Symfony\Component\Process\Process.php on line 144
AllenEllis commented 5 years ago

I had a similar issue too. Instead of adding a new issue here's my write-up:


Versionpress for me was failing on the system requirements check, just rendering a mostly blank page with no error messages.

Fortunately I noticed this in the Apache error log:

PHP message: PHP Fatal error: Uncaught Symfony\Component\Process\Exception\RuntimeException: The Process class relies on proc_open, which is not available on your PHP installation. in /home/phxav/webapps/phxav/wp-content/plugins/versionpress/vendor/symfony/process/Process.php:15

It would be nice if the activation screen could catch this exception and show a similar error to the user.

After searching online, the hosts documentation says that proc_open() is required, but it could go an extra step by providing a hint as to how to fix ("Remove proc_open from the php_admin_value[disable_functions] in your PHP configuration file"). Also it leaves me wondering if I need to allow similar functions, like proc_close, proc_nice, etc?

borekb commented 5 years ago

@AllenEllis Thanks for writing this. If you find out more about proc_close, proc_nice or a way to gracefully handle missing proc_open, we'd be thankful for a PR 🙏.