Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated cron shell script to call php binary with php.ini config argument #3834

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

seifer7
Copy link
Contributor

@seifer7 seifer7 commented Feb 15, 2024

Description (*)

Running PHP from CLI does not load the php.ini configuration file from the current directory (confirmed here.)
This can result in unexpected behaviour.
Simply adding the -c parameter to the php binary call and specifying the Magento install directory will mean that the CLI php will more accurately reflect the environment that the HTTP server is using.

Related Pull Requests

Fixed Issues (if relevant)

Manual testing scenarios (*)

  1. Apply the change to your cron.sh file
  2. Allow your cron to run
  3. Examine the results and ensure no new errors occurred

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All automated tests passed successfully (all builds are green)
  • Add yourself to contributors list

@pquerner
Copy link
Contributor

This is BC and I think its out of scope to fix that. It should be documented somewhere, yes but not further.

@addison74
Copy link
Contributor

I agree @pquerner. As long as there is no php.ini in the root directory of OpenMage, but only a php.ini.sample, I would not make this change in the code. I would mention it in the OpenMage documentation, in the section related to php.ini.sample. Practically, whoever wants to use the php.ini file must change that file manually. It is an omission for a particular situation, nothing more.

@fballiano
Copy link
Contributor

quick brainstorm: I think this PR would need to add a parameter to the script (eg: "cron.php -usephpini") which then checks for the existance of that file (or the file is directly passed as an argument) and then added to the cron.php. this way it wouldn't be a breaking change

@seifer7
Copy link
Contributor Author

seifer7 commented Feb 17, 2024

quick brainstorm: I think this PR would need to add a parameter to the script (eg: "cron.php -usephpini") which then checks for the existance of that file (or the file is directly passed as an argument) and then added to the cron.php. this way it wouldn't be a breaking change

I like this idea. I'll see what I can come up with and update this.

@seifer7 seifer7 marked this pull request as draft February 17, 2024 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants