0

Hi so I have problem dealing with changing PHP version on Debian Wheezy server. It was previously Debian Squeeze with PHP 5.2.17, and I made a dist upgrade and also upgraded everything related to PHP (PHP 5.6.30).

    "which php" command gives:
    /usr/local/bin/php

Under that path there is executable for php and php-cgi which with "-v" gives 5.6.30

   php -v
   php5 -v
   php-cgi -v
   also gives PHP 5.6.30

The only path where something is wrong is /usr/local/php5/bin because in that folder ./php gives version 5.2.17 and it is the same version httpd is using somehow. I've tried simply replacing the executables but it gives Internal Server Error.

I've tried also apt-get remove anything php related and reinstall php5 but it won't work either.

There is really strange configuration on this server involving many VirtualHosts and httpd (don't really know, but /etc/init.d/apache2 start/stop doesn't work, only /etc/init.d/httpd start/stop. I can't really change everything there because I won't be able to configure the whole thing from scratch.

Any ideas how to force httpd to use php-cgi 5.6.30 instead of this 5.2.17 old thing?

phpinfo(); returns that CGI/FastCGI is used.

J. Prorok
  • 3
  • 2

1 Answers1

1

Since the PHP is found at /usr/local/bin, it means that someone has compiled PHP and Apache themselves, and installed them.

In order to use the distribution's Apache, you need to find where the httpd version of Apache and its configuration files are. Then you need to copy the configuration files to /etc/apache2.

You might also need to check the PHP configuration files.

It could be best to re-build the configuration from scratch though.

Tero Kilkanen
  • 34,499
  • 3
  • 38
  • 58
  • I've decided to reinstall everything from scratch (including setting up Debian 8 and all configuration). Thanks for confirmation that it was compiled by previous admin by hand. – J. Prorok Apr 18 '17 at 19:02