0

Mac OSX preinstalled php version is 5.5.38, I have installed another version which is 7.0.14

I get php version from web page which is called phpinfo(), it shows 5.5.38 enter image description here

However, I open command window ,and I type the command below:

MacBook-AIR-Jerry:local sooglejay$ which php
/usr/local/bin/php
MacBook-AIR-Jerry:local sooglejay$ /usr/local/bin/php -v
PHP 7.0.14 (cli) (built: Dec  8 2016 23:34:17) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies

I know , the web page which is called phpinfo(), is powered by php5.5.38, which is the builded php version in my mac osx, and I also see apache http-conf, which reveals that apache loads libphp5.so

LoadModule php5_module libexec/apache2/libphp5.so

question is : How can I let apache know that, hey man, php versioin is 7 not 5 ?

2
  • Try to comment out the line in httpd.conf LoadModule php5_module libexec/apache2/libphp5.so Commented Jan 4, 2017 at 13:16
  • thanks for your favor, I have already solved it, thanks to @Iurii Drozdov Commented Jan 4, 2017 at 13:30

2 Answers 2

1

Try this:

LoadModule php7_module libexec/apache2/libphp7.so

you should change libexec/apache2/libphp7.so to real path on your system.(might look like /usr/local/opt/php71/libexec/apache2/libphp7.so)

Sign up to request clarification or add additional context in comments.

Comments

1

You probably have both versions installed. this is a good resource - even though it's on windows it tells you the configurations you need to change.

Look for Apache24\conf\httpd.conf and search for lines similar to these (you found 1!):

AddHandler application/x-httpd-php .php

AddType application/x-httpd-php .php .html

LoadModule php7_module "path/to/php7/php7apache2_4.dll"

PHPIniDir "c:/php7"

You will have these with php5, except maybe the first two which would be similar/same. Change the versions as needed.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.