Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

PHP Not executing #394

Closed
justinlevi opened this issue Jan 25, 2016 · 8 comments
Closed

PHP Not executing #394

justinlevi opened this issue Jan 25, 2016 · 8 comments
Labels

Comments

@justinlevi
Copy link
Contributor

Windows 7 Enterprise

Vagrant 1.8.1,
DrupalVM 2.1.2
VirtualBox Version 5.0.14 r105127

PHP is rendering as straight text. Trying to look into this further... Any help is appreciated.

@geerlingguy
Copy link
Owner

@justinlevi - Please see the release notes: https://github.com/geerlingguy/drupal-vm/releases/tag/2.2.1

If you would like to revert back to using mod_php instead of FPM, you can do so by destroying your VM, then following the instructions above the php FPM settings in example.config.yml: https://github.com/geerlingguy/drupal-vm/blob/master/example.config.yml#L202-L204

@justinlevi
Copy link
Contributor Author

@geerlingguy - Thanks for the link. I believe I followed the release notes as far as adding the extra parameters to my config.yml file but I'm still having some issues getting this VM up and running.

Do I need to revert back to mod_php instead of FPM? I'd prefer to use the default FPM as it seems like that's what comes standard with the latest versions of this VM config.

After adding the ProxyPassmatch in the extra_parameters to each apache_vhost I'm now seeing this error:

==> drupalvm: NOTIFIED: [geerlingguy.apache | restart apache] *******************************
==> drupalvm: failed: [localhost] => {"failed": true}
==> drupalvm: msg: Output of config test was:
==> drupalvm: AH00526: Syntax error on line 13 of /etc/apache2/sites-enabled/vhosts.conf:
==> drupalvm: Invalid command 'ProxyPassMatch', perhaps misspelled or defined by a module not included in the server con
figuration
==> drupalvm: Action 'configtest' failed.
==> drupalvm: The Apache error log may have more information.

Here is my config.yml apache settings:

apache_vhosts:
  - servername: "{{ drupal_domain }}"
    documentroot: "{{ drupal_core_path }}"
    extra_parameters: |
          ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}"

  - servername: "adminer.drupalvm.dev"
    documentroot: "/opt/adminer"
    extra_parameters: |
          ProxyPassMatch ^/(.*\.php(/.*)?)$ "unix:/var/run/php5-fpm.sock|fcgi://127.0.0.1:9000/opt/adminer"

  - servername: "xhprof.drupalvm.dev"
    documentroot: "/usr/share/php/xhprof_html"
    extra_parameters: |
          ProxyPassMatch ^/(.*\.php(/.*)?)$ "unix:/var/run/php5-fpm.sock|fcgi://127.0.0.1:9000/usr/share/php/xhprof_html"

  - servername: "pimpmylog.drupalvm.dev"
    documentroot: "/usr/share/php/pimpmylog"
    extra_parameters: |
          ProxyPassMatch ^/(.*\.php(/.*)?)$ "unix:/var/run/php5-fpm.sock|fcgi://127.0.0.1:9000/usr/share/php/pimpmylog"

If I vagrant ssh into the VM and try to start apache directly with: sudo service apache2 restart I'm seeing this:

 * The apache2 configtest failed.
Output of config test was:
AH00526: Syntax error on line 13 of /etc/apache2/sites-enabled/vhosts.conf:
Invalid command 'ProxyPassMatch', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.

Seems that 2.1.2 doesn't load the proxy module??? Perhaps I'm missing a requirement somewhere...

Hmmmm...

'UPDATE`

I went in and manually applied the changes from
#346

Seems that I was missing this line from the playbook.yml

- { role: geerlingguy.apache-php-fpm, when: drupalvm_webserver == 'apache' }

and this line from the requirements.yml

- src: geerlingguy.apache-php-fpm

yup, that was the issue. I'm up and running now.

@geerlingguy
Copy link
Owner

@justinlevi - Perfect! Yeah, I was going to point you to that next—you could also grab the two mods from https://github.com/geerlingguy/ansible-role-apache-php-fpm/blob/master/tasks/configure-Debian.yml and put them in the apache_mods_enabled config as an alternative.

@justinlevi
Copy link
Contributor Author

@geerlingguy - Running into one new issue.

http://adminer.drupalvm.dev is not working for me. If I curl http://adminer.drupalvm.dev from within vagrant ssh I'm getting a 503 Service Unavailable error.

I can get the same error via chrome if I add the subdomains to my local hosts file as well.

What's the trick to get adminer to work in this case?

@geerlingguy
Copy link
Owner

@justinlevi - How do you have that domain configured inside apache_vhosts?

@Monstrel
Copy link

@justinlevi php-fpm isn't configured to listen on unix sockets. Remove "unix:/var/run/php5-fpm.sock|" from the applicable lines to cause it to ask via network.

@geerlingguy
Copy link
Owner

Oops! That's my fault; I put the wrong things in example.config.yml. Fixing now.

@geerlingguy
Copy link
Owner

@justinlevi - Please see the above commit.

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

No branches or pull requests

3 participants