You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
run a script as root that created a new midgard2 configuration in /etc/midgard2/conf.d.
as normal user, run php -v from the command line
Expected Result:
output of the currently installed PHP version information
Actual Result:
PHP Warning: Failed to read my_new_config config file. Permission denied in Unknown on line 0
PHP Warning: [Midgard2 minit] Failed to initialize configs in Unknown on line 0
PHP Fatal error: Unable to start midgard2 module in Unknown on line 0
I should add that the new config file is not even referenced in php.ini or anything. But mgd2 seems to check all files in the folder for some reason, and if one of them is not readable, you can't run any php code until you fix this
The text was updated successfully, but these errors were encountered:
That is correct. Please make sure midgard.http is Off for cli. This "unclear" and implicit behavior is done to make it possible to read config files with root permission before the privileges are dropped.
What I don't understand is why config files have to be read in the first place? Wouldn't it be better to do a lazy lookup, i.e. search for the file only when read_config or something similar is called?
I can of course change the config, but this requires further customization, since in Ubuntu (and Debian, too, I think), the php conf.d is a symlink, so by default all sapis use the same midgard config. It's not such a big deal, but yet another customization you have to remember to do when installing a new midgard server
This is the nature of PHP. We have to register classes when module is loaded. read_config() to open connection is one thing, register classes is another one.
Steps to reproduce:
php -v
from the command lineExpected Result:
Actual Result:
I should add that the new config file is not even referenced in php.ini or anything. But mgd2 seems to check all files in the folder for some reason, and if one of them is not readable, you can't run any php code until you fix this
The text was updated successfully, but these errors were encountered: