kasparsd/php-7-debian

How to set this up with apache

b3wii opened this issue · 5 comments

b3wii commented

I have apache2 running, build and installed php7 cli and fpm. When i open a php page apache renders the code as text. How do i tell apache to use the newly installed php7? I'm on Wheezy btw.

I have apache2 running, build and installed php7 cli and fpm. When i open a php page apache renders the code as text. How do i tell apache to use the newly installed php7? I'm on Wheezy btw.

Same issue here, using Debian 7 Wheezy. Did you, or anyone, ever resolve this?

@b3wii, @Ken-vdE See #9 and #49 for links and suggestions.

@b3wii, @Ken-vdE See #9 and #49 for links and suggestions.

Unfortunately not, everything seems installed and working... I've restarted all the important services and apache2 is still serving out php files as plain text. I already checked if I was using <?php instead of <?. Furthermore I am able to php -v, everything should work, it just doesn't...

apache2 is still serving out php files as plain text

It probably means that Apache isn't passing the file through the FPM processing.

Did you adjust the listen directive in /usr/local/php7/etc/php-fpm.d/www.conf to use an FPM socket listen = /run/php/php-fpm.sock instead of a network port per this comment?

apache2 is still serving out php files as plain text

It probably means that Apache isn't passing the file through the FPM processing.

Did you adjust the listen directive in /usr/local/php7/etc/php-fpm.d/www.conf to use an FPM socket listen = /run/php/php-fpm.sock instead of a network port per this comment?

I did now, it does not seem to work. If you want to reproduce the issue you can take the following steps:

  1. Install Vagrant & VirtualBox
  2. Run vagrant box add debian/wheezy64 in console
  3. vagrant init debian/wheezy64 in a folder with a php file
  4. set the Vagrantfile to contain
    • config.vm.box = "debian/wheezy64"
    • config.vm.network "forwarded_port", guest: 80, host: 8080
    • and:
config.vm.provision "shell", inline: <<-SHELL
  set -x
  # use the google dns because of error when resolving domain security.debian.org
  echo -e "domain nice.lan\nsearch nice.lan\nnameserver 8.8.8.8\nnameserver 8.8.4.4\nnamerserver 10.0.2.3" > /etc/resolv.conf
  apt-get install -y git apache2 curl
  cd /tmp
  git clone https://github.com/kasparsd/php-7-debian.git
  cd php-7-debian/
  ./build.sh
  ./install.sh

  apt-get -y update && apt-get -y upgrade
  if ! [ -L /var/www ]; then
    rm -rf /var/www
    ln -fs /vagrant /var/www
  fi
SHELL
  1. Visit localhost:8080 or localhost:8080/your-php-file.php and it serves the php content as plain text