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

php-fpm issues (container runtime) #404

Open
paulbadcock opened this issue Mar 20, 2023 · 4 comments
Open

php-fpm issues (container runtime) #404

paulbadcock opened this issue Mar 20, 2023 · 4 comments
Labels

Comments

@paulbadcock
Copy link

Logic issues with the following

https://github.com/sclorg/s2i-php-container/blob/master/8.1/s2i/bin/run#L59-L68

if [ "x$PLATFORM" == "xel9" ] || [ "x$PLATFORM" == "xfedora" ]; then
  if [ -n "${PHP_FPM_RUN_DIR:-}" ]; then
    /bin/ln -s /dev/stderr ${PHP_FPM_LOG_PATH}/error.log
    mkdir -p ${PHP_FPM_RUN_DIR}
    chmod -R a+rwx ${PHP_FPM_RUN_DIR}
    chown -R 1001:0 ${PHP_FPM_RUN_DIR}
    mkdir -p ${PHP_FPM_LOG_PATH}
    chmod -R a+rwx ${PHP_FPM_LOG_PATH}
    chown -R 1001:0 ${PHP_FPM_LOG_PATH}
  fi

fi

On runtime it's trying to create folders and set permissions in an immutable object, shouldn't this be in the assemble script and not at runtime?

Also there's functional issues such as trying to symlink to the error.log before the mkdir runs on the ${PHP_FPM_LOG_PATH} but the bigger issue is this won't run inside the assembled container as the following output indicates running as non root.

chmod: changing permissions of '/run/php-fpm': Operation not permitted
chown: changing ownership of '/run/php-fpm': Operation not permitted
chmod: changing permissions of '/var/log/php-fpm': Operation not permitted
chown: changing ownership of '/var/log/php-fpm/error.log': Operation not permitted
chown: changing ownership of '/var/log/php-fpm': Operation not permitted
@phracek
Copy link
Member

phracek commented Mar 27, 2023

@remicollet Can you please provide to @paulbadcock why mod_php on RHEL8 is enabled instead of FPM? Personally, I could not find this information. It could be added to the README.md.

@paulbadcock Is it related to RHEL8 or RHEL9? I can not find this information in the issue. Do you have a Bugzilla?

@remicollet
Copy link
Contributor

@remicollet Can you please provide to @paulbadcock why mod_php on RHEL8 is enabled instead of FPM?

This was a choice (not mine) to avoid complexity in first EL8 image

EL9 use FPM as mod_php is no more available

Other may exist in the future (such as 1 container for webserver, 1 for php backend...)

@paulbadcock
Copy link
Author

@remicollet Can you please provide to @paulbadcock why mod_php on RHEL8 is enabled instead of FPM? Personally, I could not find this information. It could be added to the README.md.

@paulbadcock Is it related to RHEL8 or RHEL9? I can not find this information in the issue. Do you have a Bugzilla?

RHEL9, no bugzilla

@roemba
Copy link

roemba commented Jun 30, 2023

We are encountering the same issue. It is unclear to me if this is also the reason why no PHP logs show up in stdout/stderr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants