php-fpm and mkdir() permission denied - but libphp7-zts.so works fine












0















I have Concrete5 site which I need to move to php-fpm from libphp7-zts.



I've configured PHP-FPM as normal with Unix socket and PHP (for example "PHP info") is being served fine. I've made sure that PHP-FPM runs as "Apache" User and "Apache" Group (RHEL7).



Relevant config of php-fpm:



[www]

user = apache
group = apache

listen = /run/php-fpm/www.sock

listen.owner = apache
listen.group = apache
listen.mode = 0660

listen.allowed_clients = 127.0.0.1

pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35

php_admin_value[error_log] = /var/log/php-fpm/www-error.log
php_admin_flag[log_errors] = on

php_value[session.save_handler] = files
php_value[session.save_path] = /var/lib/php/fpm/session
php_value[soap.wsdl_cache_dir] = /var/lib/php/fpm/wsdlcache


Unfortunately, when application (CMS, Concrete5) tries to do anything on the content I'm getting "Permission Denied" - so as per title:



mkdir() Permission Denied.



Selinux is in permissive mode, permissions on files and folders seem to be OK as (now unsupported) libphp7-zts works fine.



Any ideas would be greatly appropriated. Thank you in advance










share|improve this question



























    0















    I have Concrete5 site which I need to move to php-fpm from libphp7-zts.



    I've configured PHP-FPM as normal with Unix socket and PHP (for example "PHP info") is being served fine. I've made sure that PHP-FPM runs as "Apache" User and "Apache" Group (RHEL7).



    Relevant config of php-fpm:



    [www]

    user = apache
    group = apache

    listen = /run/php-fpm/www.sock

    listen.owner = apache
    listen.group = apache
    listen.mode = 0660

    listen.allowed_clients = 127.0.0.1

    pm = dynamic
    pm.max_children = 50
    pm.start_servers = 5
    pm.min_spare_servers = 5
    pm.max_spare_servers = 35

    php_admin_value[error_log] = /var/log/php-fpm/www-error.log
    php_admin_flag[log_errors] = on

    php_value[session.save_handler] = files
    php_value[session.save_path] = /var/lib/php/fpm/session
    php_value[soap.wsdl_cache_dir] = /var/lib/php/fpm/wsdlcache


    Unfortunately, when application (CMS, Concrete5) tries to do anything on the content I'm getting "Permission Denied" - so as per title:



    mkdir() Permission Denied.



    Selinux is in permissive mode, permissions on files and folders seem to be OK as (now unsupported) libphp7-zts works fine.



    Any ideas would be greatly appropriated. Thank you in advance










    share|improve this question

























      0












      0








      0


      0






      I have Concrete5 site which I need to move to php-fpm from libphp7-zts.



      I've configured PHP-FPM as normal with Unix socket and PHP (for example "PHP info") is being served fine. I've made sure that PHP-FPM runs as "Apache" User and "Apache" Group (RHEL7).



      Relevant config of php-fpm:



      [www]

      user = apache
      group = apache

      listen = /run/php-fpm/www.sock

      listen.owner = apache
      listen.group = apache
      listen.mode = 0660

      listen.allowed_clients = 127.0.0.1

      pm = dynamic
      pm.max_children = 50
      pm.start_servers = 5
      pm.min_spare_servers = 5
      pm.max_spare_servers = 35

      php_admin_value[error_log] = /var/log/php-fpm/www-error.log
      php_admin_flag[log_errors] = on

      php_value[session.save_handler] = files
      php_value[session.save_path] = /var/lib/php/fpm/session
      php_value[soap.wsdl_cache_dir] = /var/lib/php/fpm/wsdlcache


      Unfortunately, when application (CMS, Concrete5) tries to do anything on the content I'm getting "Permission Denied" - so as per title:



      mkdir() Permission Denied.



      Selinux is in permissive mode, permissions on files and folders seem to be OK as (now unsupported) libphp7-zts works fine.



      Any ideas would be greatly appropriated. Thank you in advance










      share|improve this question














      I have Concrete5 site which I need to move to php-fpm from libphp7-zts.



      I've configured PHP-FPM as normal with Unix socket and PHP (for example "PHP info") is being served fine. I've made sure that PHP-FPM runs as "Apache" User and "Apache" Group (RHEL7).



      Relevant config of php-fpm:



      [www]

      user = apache
      group = apache

      listen = /run/php-fpm/www.sock

      listen.owner = apache
      listen.group = apache
      listen.mode = 0660

      listen.allowed_clients = 127.0.0.1

      pm = dynamic
      pm.max_children = 50
      pm.start_servers = 5
      pm.min_spare_servers = 5
      pm.max_spare_servers = 35

      php_admin_value[error_log] = /var/log/php-fpm/www-error.log
      php_admin_flag[log_errors] = on

      php_value[session.save_handler] = files
      php_value[session.save_path] = /var/lib/php/fpm/session
      php_value[soap.wsdl_cache_dir] = /var/lib/php/fpm/wsdlcache


      Unfortunately, when application (CMS, Concrete5) tries to do anything on the content I'm getting "Permission Denied" - so as per title:



      mkdir() Permission Denied.



      Selinux is in permissive mode, permissions on files and folders seem to be OK as (now unsupported) libphp7-zts works fine.



      Any ideas would be greatly appropriated. Thank you in advance







      linux permissions apache-http-server php redhat-enterprise-linux






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 7 at 12:07









      ChrisChris

      1,641714




      1,641714






















          1 Answer
          1






          active

          oldest

          votes


















          0














          I have found and corrected issue with this set up. This is the portion of the config to blame:



          php_value[session.save_path]    = /var/lib/php/fpm/session
          php_value[soap.wsdl_cache_dir] = /var/lib/php/fpm/wsdlcache


          so whatever you have in php.ini for session.save_pathgets overwritten (so to speak) and needs correct permissions for the user which php-fpm runs to be able to write. In my instance I've matched that with php.ini config and that seems to be working as expected.



          Hope that helps






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1403097%2fphp-fpm-and-mkdir-permission-denied-but-libphp7-zts-so-works-fine%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I have found and corrected issue with this set up. This is the portion of the config to blame:



            php_value[session.save_path]    = /var/lib/php/fpm/session
            php_value[soap.wsdl_cache_dir] = /var/lib/php/fpm/wsdlcache


            so whatever you have in php.ini for session.save_pathgets overwritten (so to speak) and needs correct permissions for the user which php-fpm runs to be able to write. In my instance I've matched that with php.ini config and that seems to be working as expected.



            Hope that helps






            share|improve this answer




























              0














              I have found and corrected issue with this set up. This is the portion of the config to blame:



              php_value[session.save_path]    = /var/lib/php/fpm/session
              php_value[soap.wsdl_cache_dir] = /var/lib/php/fpm/wsdlcache


              so whatever you have in php.ini for session.save_pathgets overwritten (so to speak) and needs correct permissions for the user which php-fpm runs to be able to write. In my instance I've matched that with php.ini config and that seems to be working as expected.



              Hope that helps






              share|improve this answer


























                0












                0








                0







                I have found and corrected issue with this set up. This is the portion of the config to blame:



                php_value[session.save_path]    = /var/lib/php/fpm/session
                php_value[soap.wsdl_cache_dir] = /var/lib/php/fpm/wsdlcache


                so whatever you have in php.ini for session.save_pathgets overwritten (so to speak) and needs correct permissions for the user which php-fpm runs to be able to write. In my instance I've matched that with php.ini config and that seems to be working as expected.



                Hope that helps






                share|improve this answer













                I have found and corrected issue with this set up. This is the portion of the config to blame:



                php_value[session.save_path]    = /var/lib/php/fpm/session
                php_value[soap.wsdl_cache_dir] = /var/lib/php/fpm/wsdlcache


                so whatever you have in php.ini for session.save_pathgets overwritten (so to speak) and needs correct permissions for the user which php-fpm runs to be able to write. In my instance I've matched that with php.ini config and that seems to be working as expected.



                Hope that helps







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 8 at 8:53









                ChrisChris

                1,641714




                1,641714






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Super User!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1403097%2fphp-fpm-and-mkdir-permission-denied-but-libphp7-zts-so-works-fine%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                    Mangá

                     ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕