Jump to content

Recommended Posts

Posted

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!";
Posted

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? 

Posted

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.

  • 1 month later...
Posted (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 by Hero
  • Like 4
  • 10 months later...
Posted

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))

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...