j-w Posted September 11, 2020 Share Posted September 11, 2020 For a worker process I need to bootstrap ProcessWire. Unfortunately somewhere in the bootstrap process the script simply exits, and I'm having problems identifying where and why. Debugging a bit I found out that somewhere during the following call in the bootstrap index.php the script is exited: echo $process->execute($config->internal); Doing a debug_backtrace in the registered shutdown function gives me only a hint to ProcessWire\{closure} Unfortunately with all php error logging on and $config->debug = Config::debugVerbose; I dont' get any more information as to why the script exits. Also tracy logs don't show anything. I already investigated if there are any culprits among the hooks but can't find anything suspicious. The script looks as follows: #!/usr/bin/php <?php namespace ProcessWire; echo "this is reached!"; include("../www/index.php"); //bootstrap ProcessWire echo "this is never reached!"; Link to comment Share on other sites More sharing options...
horst Posted September 11, 2020 Share Posted September 11, 2020 Maybe a bit OT: with which php version is the script processed, and which set of modules are enabled for the php processor? Is it the same version the webserver is running on? Link to comment Share on other sites More sharing options...
j-w Posted September 14, 2020 Author Share Posted September 14, 2020 It's PHP 7.4.3 with Litespeed 7.6 and Zend Engine 3.4.0 (ionCube 10.4.0, OPcache 7.4.8), running ProcessWire 3.0.165. It's the same version as for the webserver. Link to comment Share on other sites More sharing options...
Hero Posted November 2, 2020 Share Posted November 2, 2020 (edited) I had the same problem and it had me perplexed for a while. My Command Line Interface script bootstraps ProcessWire and then fails without even the tiniest hint of an error message. In my case, the problem was that code from /site/ready.php was being executed when ProcessWire was bootstrapped. The code I had in /site/ready.php was only intended for execution in specific situations while web browsing (not CLI). So I took the code inside that file and wrapped it inside this: if(php_sapi_name() !== "cli") { // code inside /site/ready.php } Edited November 2, 2020 by Hero 4 Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted September 26, 2021 Share Posted September 26, 2021 I got the same error. But my error seems to be coming from one of the modules. At least commenting out this string in the ProcessWire::ready() makes it work // $this->fuel->get('modules')->triggerReady(); Does anyone know how do to deal with this? I am disabling site modules one by one to figure out, which one is causing trouble, but without success so far. Is there a way to quickly find out the root of the problem? Maybe there is a way to disable modules while bootstrapping (but it might not be such a good idea, as they can add functionality that is supposed to work when running bootstrapped scripts). Any help appreciated)) Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted September 26, 2021 Share Posted September 26, 2021 As always, as soon as you write a post you find a solution) I did turn on $config->debug and figured out it was related with PW not being able to set session as headers already sent. That was my test output before the inclusion of the ProcessWire index.php in the bootsrap script. Cannot output anything before you include it. The issue persists. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now