Puphpet: Can't restart PHP-FPM with PHP7

Created on 24 Apr 2016  路  5Comments  路  Source: puphpet/puphpet

Using a default PuPHPet config to install PHP 7 on CentOS with NGINX the installation shows no errors however when I try to restart the php-fpm using sudo service php-fpm restart I get the following error -

$ sudo service php-fpm restart
Stopping php-fpm:                                          [FAILED]
Starting php-fpm: [24-Apr-2016 13:54:09] ERROR: unable to bind listening socket for address '127.0.0.1:9000': Address already in use (98)
[24-Apr-2016 13:54:09] ERROR: FPM initialization failed
                                                           [FAILED]

My config.yaml -

vagrantfile:
    target: local
    vm:
        provider:
            local:
                box: puphpet/centos65-x64
                box_url: puphpet/centos65-x64
                box_version: '0'
                chosen_virtualizer: virtualbox
                virtualizers:
                    virtualbox:
                        modifyvm:
                            natdnshostresolver1: false
                        showgui: 0
                    vmware:
                        numvcpus: 1
                    parallels:
                        use_linked_clone: 0
                        check_guest_tools: 0
                        update_guest_tools: 0
                machines:
                    vflm_r9fijzwv5kxd:
                        id: machine1
                        hostname: machine1.puphpet
                        network:
                            private_network: 192.168.47.47
                            forwarded_port:
                                vflmnfp_sggmuqsyuypa:
                                    host: '9909'
                                    guest: '22'
                                vflmnfp_ypw5zkxwptec:
                                    host: '54320'
                                    guest: '5432'
                                vflmnfp_q3jfov5eiluf:
                                    host: '8025'
                                    guest: '8025'
                        memory: '2048'
                        cpus: '1'
        provision:
            puppet:
                manifests_path: puphpet/puppet/manifests
                module_path: puphpet/puppet/modules
                options:
                    - '--verbose'
                    - '--hiera_config /vagrant/puphpet/puppet/hiera.yaml'
        synced_folder:
            vflsf_si66pdnux0tt:
                source: ./
                target: /var/www
                sync_type: nfs
                smb:
                    smb_host: ''
                    smb_username: ''
                    smb_password: ''
                    mount_options:
                        dir_mode: '0775'
                        file_mode: '0664'
                rsync:
                    args:
                        - '--verbose'
                        - '--archive'
                        - '-z'
                    exclude:
                        - .vagrant/
                        - .git/
                    auto: 'true'
                owner: www-data
                group: www-data
        usable_port_range:
            start: 10200
            stop: 10500
        post_up_message: ''
    ssh:
        host: 'false'
        port: 'false'
        private_key_path: 'false'
        username: vagrant
        guest_port: 'false'
        keep_alive: '1'
        forward_agent: 'false'
        forward_x11: 'false'
        shell: 'bash -l'
        insert_key: 'false'
    vagrant:
        host: detect
    proxy:
        http: ''
        https: ''
        ftp: ''
        no_proxy: ''
server:
    install: '1'
    packages:
        - nano
        - vim-common
        - htop
users_groups:
    install: '1'
    groups:
        - nginx
    users:
        - nginx
locale:
    install: '1'
    settings:
        default_locale: en_GB.UTF-8
        locales:
            - en_GB.UTF-8
            - en_US.UTF-8
        timezone: Europe/London
firewall:
    install: '1'
    rules: {  }
cron:
    install: '1'
    jobs: {  }
nginx:
    install: '1'
    settings:
        default_vhost: 1
        proxy_buffer_size: 128k
        proxy_buffers: '4 256k'
        proxy_connect_timeout: 600s
        proxy_send_timeout: 600s
        proxy_read_timeout: 600s
        names_hash_bucket_size: 128
    upstreams: {  }
    vhosts:
        nxv_6nnra5rih2jt:
            server_name: machine1.dev
            www_root: /var/www/machine1
            listen_port: '80'
            index_files:
                - index.html
                - index.htm
                - index.php
            client_max_body_size: 64m
            ssl: '0'
            ssl_cert: LETSENCRYPT
            ssl_key: LETSENCRYPT
            ssl_port: '443'
            ssl_protocols: ''
            ssl_ciphers: ''
            rewrite_to_https: '1'
            spdy: '1'
            locations:
                nxvl_vwoe6g4932q6:
                    location: /
                    autoindex: 'on'
                    internal: 'true'
                    try_files:
                        - $uri
                        - $uri/
                        - /index.php$is_args$args
                    fastcgi: ''
                    fastcgi_index: ''
                    fastcgi_split_path: ''
                    proxy: ''
                    proxy_redirect: ''
                nxvl_1oqy6zizv9ed:
                    location: '~ \.php$'
                    try_files:
                        - $uri
                        - $uri/
                        - /index.php$is_args$args
                    fastcgi: '127.0.0.1:9000'
                    fastcgi_index: index.php
                    fastcgi_split_path: '^(.+\.php)(/.*)$'
                    fast_cgi_params_extra:
                        - 'SCRIPT_FILENAME $request_filename'
                        - 'APP_ENV dev'
                    set:
                        - '$path_info $fastcgi_path_info'
                    proxy: ''
                    proxy_redirect: ''
    proxies: {  }
apache:
    install: '0'
    settings:
        version: 2.4
        user: www-data
        group: www-data
        default_vhost: true
        manage_user: false
        manage_group: false
        sendfile: 0
    modules:
        - proxy_fcgi
        - rewrite
    vhosts:
        av_wlworpi8mhqw:
            servername: awesome.dev
            serveraliases:
                - www.awesome.dev
            docroot: /var/www/awesome
            port: '80'
            setenv:
                - 'APP_ENV dev'
            setenvif:
                - 'Authorization "(.*)" HTTP_AUTHORIZATION=$1'
            custom_fragment: ''
            ssl: '0'
            ssl_cert: ''
            ssl_key: ''
            ssl_chain: ''
            ssl_certs_dir: ''
            ssl_protocol: ''
            ssl_cipher: ''
            directories:
                avd_j7eltxqop2ao:
                    path: /var/www/awesome
                    options:
                        - Indexes
                        - FollowSymlinks
                        - MultiViews
                    allow_override:
                        - All
                    require:
                        - 'all granted'
                    custom_fragment: ''
                    files_match:
                        avdfm_20l1tgknf5jz:
                            path: \.php$
                            sethandler: 'proxy:fcgi://127.0.0.1:9000'
                            custom_fragment: ''
                            provider: filesmatch
                    provider: directory
letsencrypt:
    install: '1'
    settings:
        email: [email protected]
    domains: {  }
php:
    install: '1'
    settings:
        version: '70'
    modules:
        php:
            - cli
        pear: {  }
        pecl: {  }
    ini:
        display_errors: 'On'
        error_reporting: '-1'
        session.save_path: /var/lib/php/session
        date.timezone: Europe/London
        memory_limit: 1024M
        upload_max_filesize: 10M
        post_max_size: 10M
    fpm_ini:
        error_log: /var/log/php-fpm.log
    fpm_pools:
        phpfp_xdpzinsiyhze:
            ini:
                prefix: www
                security.limit_extensions: .php
                user: www-user
                group: www-data
                listen: '127.0.0.1:9000'
    composer: '1'
    composer_home: ''
xdebug:
    install: '1'
    settings:
        xdebug.default_enable: '1'
        xdebug.remote_autostart: '0'
        xdebug.remote_connect_back: '1'
        xdebug.remote_enable: '1'
        xdebug.remote_handler: dbgp
        xdebug.remote_port: '9009'
blackfire:
    install: '0'
    settings:
        server_id: ''
        server_token: ''
        agent:
            http_proxy: ''
            https_proxy: ''
            log_file: stderr
            log_level: '1'
        php:
            agent_timeout: '0.25'
            log_file: ''
            log_level: '1'
xhprof:
    install: '0'
wpcli:
    install: '0'
    version: v0.21.1
drush:
    install: '0'
    version: 8.0.5
ruby:
    install: '1'
    versions:
        rv_mr7uoy3b5ybu:
            default: '1'
            bundler: '1'
            version: 2.1.2
            gems:
                - sass
                - compass
python:
    install: '1'
    packages: {  }
    versions: {  }
nodejs:
    install: '1'
    settings:
        version: '0.12'
    npm_packages:
        - gulp
        - grunt
        - yo
        - jslint
        - csslint
        - coffee-script
        - grunt-cli
        - eslint
        - bower
hhvm:
    install: '0'
    nightly: 0
    composer: '1'
    composer_home: ''
    settings: {  }
    server_ini:
        hhvm.server.host: 127.0.0.1
        hhvm.server.port: '9000'
        hhvm.log.use_log_file: '1'
        hhvm.log.file: /var/log/hhvm/error.log
    php_ini:
        display_errors: 'On'
        error_reporting: '-1'
        date.timezone: UTC
mariadb:
    install: '1'
    settings:
        version: '10.1'
        root_password: vagrant
        override_options: {  }
    adminer: 0
    users:
        mariadbnu_wg1r1f2f1xjp:
            name: magestead
            password: vagrant
    databases:
        mariadbnd_nlm6yvr9n0v8:
            name: magestead
            sql: ''
    grants:
        mariadbng_gj3gq1ua5fsi:
            user: magestead
            table: '*.*'
            privileges:
                - ALL
mysql:
    install: '0'
    settings:
        version: '5.6'
        root_password: '123'
        override_options: {  }
    adminer: 0
    users:
        mysqlnu_8glryxddw3i0:
            name: dbuser
            password: '123'
    databases:
        mysqlnd_wypszipr49oe:
            name: dbname
            sql: ''
    grants:
        mysqlng_3l289zyyealm:
            user: dbuser
            table: '*.*'
            privileges:
                - ALL
postgresql:
    install: '0'
    settings:
        global:
            encoding: UTF8
            version: '9.4'
        server:
            postgres_password: '123'
    databases: {  }
    users: {  }
    grants: {  }
    adminer: 0
mongodb:
    install: '0'
    settings:
        bind_ip: 127.0.0.1
        port: '27017'
    globals:
        version: 2.6.0
    databases: {  }
redis:
    install: '1'
    settings:
        port: '6379'
sqlite:
    install: '0'
    adminer: 0
    databases: {  }
mailhog:
    install: '1'
    settings:
        smtp_ip: 0.0.0.0
        smtp_port: 1025
        http_ip: 0.0.0.0
        http_port: '8025'
        path: /usr/local/bin/mailhog
beanstalkd:
    install: '0'
    settings:
        listenaddress: 0.0.0.0
        listenport: '11300'
        maxjobsize: '65535'
        maxconnections: '1024'
        binlogdir: /var/lib/beanstalkd/binlog
        binlogfsync: null
        binlogsize: '10485760'
    beanstalk_console: 0
rabbitmq:
    install: '0'
    settings:
        port: '5672'
    users: {  }
    vhosts: {  }
    plugins: {  }
elastic_search:
    install: '0'
    settings:
        version: 2.3.1
        java_install: true
    instances:
        esi_qidopk4x8keu:
            name: es-01
solr:
    install: '0'
    settings:
        version: 4.10.2
        port: '8984'


bug

All 5 comments

Do me a favor and run:

sudo service php-fpm status

do you get:

php-fpm dead but subsys locked?

After provision, I've been running into this issue. It seems as though on first boot and provision, php-fpm on PHP 7 crashes.

I kill all php-fpm running processes, and rmove the lock and trying to start php-fpm. It starts, but then immediately crashes and it leads back to the issue in your ticket and dead but subsys locked.

Looks like this no longer occurs. Please try with the newest boxes.

I am still experiencing this issue with the latest puphpet/ubuntu1404-x64 box, the latest vagrant (1.8.6), and the latest virtualbox (5.1.6) on a Ubuntu 16.04 host.
sudo service php7.0-fpm just returns php7.0-fpm stop/waiting. I'll attach my config.yaml below:

vagrantfile:
    target: local
    vm:
        provider:
            local:
                box: puphpet/ubuntu1404-x64
                box_url: puphpet/ubuntu1404-x64
                box_version: '0'
                chosen_virtualizer: virtualbox
                virtualizers:
                    virtualbox:
                        modifyvm:
                            natdnshostresolver1: false
                        showgui: 0
                    vmware:
                        numvcpus: 1
                    parallels:
                        linked_clone: 0
                        check_guest_tools: 0
                        update_guest_tools: 0
                machines:
                    vflm_yhu4imhv1la9:
                        id: Anonymous
                        hostname: anonymous.puphpet
                        network:
                            private_network: 192.168.56.101
                            forwarded_port:
                                vflmnfp_gf2bsujvog6i:
                                    host: '6119'
                                    guest: '22'
                        memory: '2048'
                        cpus: '2'
        provision:
            puppet:
                manifests_path: puphpet/puppet/manifests
                module_path:
                    - puphpet/puppet/modules
                    - puphpet/puppet/manifests
                options:
                    - '--verbose'
                    - '--hiera_config /vagrant/puphpet/puppet/hiera.yaml'
        synced_folder:
            vflsf_gme5cjm6tlca:
                source: ./
                target: /var/www
                sync_type: default
                smb:
                    smb_host: ''
                    smb_username: ''
                    smb_password: ''
                    mount_options:
                        dir_mode: '0775'
                        file_mode: '0664'
                rsync:
                    args:
                        - '--verbose'
                        - '--archive'
                        - '-z'
                    exclude:
                        - .vagrant/
                        - .git/
                    auto: 'true'
                owner: www-data
                group: www-data
        usable_port_range:
            start: 10200
            stop: 10500
        post_up_message: ''
    ssh:
        host: 'false'
        port: 'false'
        private_key_path: 'false'
        username: vagrant
        guest_port: 'false'
        keep_alive: '1'
        forward_agent: 'false'
        forward_x11: 'false'
        shell: 'bash -l'
        insert_key: 'false'
    vagrant:
        host: detect
    proxy:
        http: ''
        https: ''
        ftp: ''
        no_proxy: ''
server:
    install: '1'
    packages:
        - vim
users_groups:
    install: '1'
    groups: {  }
    users: {  }
locale:
    install: '1'
    settings:
        default_locale: en_US.UTF-8
        locales:
            - en_GB.UTF-8
            - en_US.UTF-8
        timezone: UTC
firewall:
    install: '1'
    rules: {  }
cron:
    install: '1'
    jobs: {  }
nginx:
    install: '1'
    settings:
        version: present
        default_vhost: 1
        proxy_buffers: '4 256k'
        proxy_buffer_size: 128k
        proxy_connect_timeout: 600s
        proxy_send_timeout: 600s
        proxy_read_timeout: 600s
        names_hash_bucket_size: 128
    upstreams: {  }
    vhosts:
        nxv_lmqh4gbzp75t:
            server_name: anonymous.dev
            server_aliases:
                - www.anonymous.dev
            www_root: /var/www/anonymous/web
            listen_port: '80'
            index_files:
                - app.php
            client_max_body_size: 1m
            ssl: '0'
            ssl_cert: ''
            ssl_key: ''
            ssl_port: '443'
            ssl_protocols: ''
            ssl_ciphers: ''
            rewrite_to_https: '1'
            spdy: '1'
            locations:
                nxvl_mhhc6psifv15:
                    location: /
                    try_files:
                        - $uri
                        - /app.php$is_args$args
                    fastcgi: ''
                    fastcgi_index: ''
                    fastcgi_split_path: ''
                    proxy: ''
                    proxy_redirect: ''
                nxvl_26l02z4vx3j2:
                    location: '~ \.php(/|$)'
                    fastcgi: '127.0.0.1:9000'
                    fastcgi_index: index.php
                    fastcgi_split_path: '^(.+\.php)(/.*)$'
                    fast_cgi_params_extra:
                        - 'SCRIPT_FILENAME $realpath_root$fastcgi_script_name'
                        - 'DOCUMENT_ROOT $realpath_root'
                        - 'APP_ENV dev'
                    set:
                        - '$path_info $fastcgi_path_info'
                    proxy: ''
                    proxy_redirect: ''
    proxies: {  }
apache:
    install: '0'
    settings:
        version: 2.4
        user: www-data
        group: www-data
        default_vhost: true
        manage_user: false
        manage_group: false
        sendfile: 0
    modules:
        - proxy_fcgi
        - rewrite
    vhosts:
        av_wmvltrq8kqwn:
            servername: awesome.dev
            serveraliases:
                - www.awesome.dev
            docroot: /var/www/awesome
            port: '80'
            setenv:
                - 'APP_ENV dev'
            setenvif:
                - 'Authorization "(.*)" HTTP_AUTHORIZATION=$1'
            custom_fragment: ''
            ssl: '0'
            ssl_cert: ''
            ssl_key: ''
            ssl_chain: ''
            ssl_certs_dir: ''
            ssl_protocol: ''
            ssl_cipher: ''
            directories:
                avd_mvflw1jlj3go:
                    path: /var/www/awesome
                    options:
                        - Indexes
                        - FollowSymlinks
                        - MultiViews
                    allow_override:
                        - All
                    require:
                        - 'all granted'
                    custom_fragment: ''
                    files_match:
                        avdfm_1xgl93zzp6ik:
                            path: \.php$
                            sethandler: 'proxy:fcgi://127.0.0.1:9000'
                            custom_fragment: ''
                            provider: filesmatch
                    provider: directory
letsencrypt:
    install: '1'
    settings:
        email: ''
    domains: {  }
php:
    install: '1'
    settings:
        version: '7.0'
    modules:
        php:
            - cli
            - intl
        pear: {  }
        pecl: {  }
    ini:
        display_errors: 'On'
        error_reporting: '-1'
        session.save_path: /var/lib/php/session
        date.timezone: UTC
    fpm_ini:
        error_log: /var/log/php-fpm.log
        upload_max_filesize: 32M
        post_max_size: 32M
    fpm_pools:
        phpfp_evorsrnn9vdm:
            ini:
                prefix: www
                listen: '127.0.0.1:9000'
                security.limit_extensions: .php
                user: www-user
                group: www-data
    composer: '1'
    composer_home: ''
xdebug:
    install: '1'
    settings:
        xdebug.idekey: PHPSTORM
        xdebug.default_enable: '1'
        xdebug.remote_autostart: '1'
        xdebug.remote_connect_back: '1'
        xdebug.remote_enable: '1'
        xdebug.remote_handler: dbgp
        xdebug.remote_port: '9123'
blackfire:
    install: '0'
    settings:
        server_id: ''
        server_token: ''
        agent:
            http_proxy: ''
            https_proxy: ''
            log_file: stderr
            log_level: '1'
        php:
            agent_timeout: '0.25'
            log_file: ''
            log_level: '1'
xhprof:
    install: '0'
wpcli:
    install: '0'
    version: v0.21.1
drush:
    install: '0'
    version: 8.0.5
ruby:
    install: '1'
    versions:
        rv_el3vnkj9fvlc:
            default: '1'
            bundler: '1'
            version: 2.3.0
            gems:
                - [email protected]
                - [email protected]
                - [email protected]
python:
    install: '1'
    packages: {  }
    versions: {  }
nodejs:
    install: '1'
    settings:
        version: '5'
    npm_packages: {  }
hhvm:
    install: '0'
    composer: '1'
    composer_home: ''
    settings: {  }
    server_ini:
        hhvm.server.host: 127.0.0.1
        hhvm.server.port: '9000'
        hhvm.log.use_log_file: '1'
        hhvm.log.file: /var/log/hhvm/error.log
    php_ini:
        display_errors: 'On'
        error_reporting: '-1'
        date.timezone: UTC
mariadb:
    install: '0'
    settings:
        version: '10.1'
        root_password: '123'
        override_options: {  }
    adminer: 0
    users:
        mariadbnu_5gee5ux7nnii:
            name: dbuser
            password: '123'
    databases:
        mariadbnd_9y1x6ibcb02p:
            name: dbname
            sql: ''
    grants:
        mariadbng_6itc2vnbti5p:
            user: dbuser
            table: '*.*'
            privileges:
                - ALL
mysql:
    install: '1'
    settings:
        version: '5.6'
        root_password: '123'
        override_options: {  }
    adminer: 0
    users:
        mysqlnu_1ibe9gzm3urm:
            name: web
            password: password
    databases:
        mysqlnd_6vparb1w70bh:
            name: anonymous
            sql: ''
        mysqlnd_i5bssfirswbe:
            name: anonymous_test
            sql: ''
    grants:
        mysqlng_f9xhhtew6haq:
            user: web
            table: '*.*'
            privileges:
                - ALL
postgresql:
    install: '0'
    settings:
        global:
            encoding: UTF8
            version: '9.4'
        server:
            postgres_password: admin
    databases:
        postsqlnd_zfjtkncqsjwh:
            dbname: anonymous
            owner: ''
        postsqlnd_zuiro0iofo0j:
            dbname: anonymous_test
            owner: ''
    users:
        postsqlnu_iuwemnkuyf4m:
            username: web
            password: password
            superuser: '1'
    grants:
        postsqlng_rdtsezim1gl8:
            role: web
            db: anonymous
            privilege:
                - ALL
        postsqlng_khb7bvz75f38:
            role: web
            db: anonymous_test
            privilege:
                - ALL
    adminer: 0
mongodb:
    install: '0'
    settings:
        bind_ip: 127.0.0.1
        port: '27017'
    globals:
        version: 2.6.0
    databases: {  }
redis:
    install: '1'
    settings:
        port: '6379'
sqlite:
    install: '0'
    adminer: 0
    databases: {  }
mailhog:
    install: '1'
    settings:
        smtp_ip: 0.0.0.0
        smtp_port: 1025
        http_ip: 0.0.0.0
        http_port: '8025'
        path: /usr/local/bin/mailhog
beanstalkd:
    install: '0'
    settings:
        listenaddress: 0.0.0.0
        listenport: '11300'
        maxjobsize: '65535'
        maxconnections: '1024'
        binlogdir: /var/lib/beanstalkd/binlog
        binlogfsync: null
        binlogsize: '10485760'
    beanstalk_console: 0
rabbitmq:
    install: '0'
    settings:
        port: '5672'
    users: {  }
    vhosts: {  }
    plugins: {  }
elastic_search:
    install: '0'
    settings:
        version: 2.3.1
        java_install: true
    instances:
        esi_2tf3aul84dbg:
            name: es-anonymous
solr:
    install: '0'
    settings:
        version: 4.10.2
        port: '8984'

Happens too with 5.6 + centos 6 with the same errors (cannot bind listening socket)

The problem seems to stem from the php-fpm init script pointing to the wrong PID file location. Not sure what the right way is to fix this, but modifying the init script so that pidfile points to "/var/run/php-fpm.pid" is what fixes my issues

This is probably because daemon's --pidfile option does not create the PID file for you. It still relies on the program being executed to actually create the file (which goes into /var/run/php-fpm.pid)

Was this page helpful?
0 / 5 - 0 ratings