Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Upgrading php from PHP 5.3.28 to PHP 5.5 didn't happen

46 views
Skip to first unread message

Alla

unread,
Jul 14, 2016, 10:57:47 AM7/14/16
to
Hello!
I am trying to solve the issue I have with phpmyadmin, and I have found out that although
I have used curl -s http://php-osx.liip.ch/install.sh | bash -s 5.5 to upgrade, the php -v
command still shows that my version is php 5.3.28. I have checked httpd.conf, and the line
LoadModule php5_module libexec/apache2/libphp5.so is uncommented.

My system: Mac OS X 10.7.5
Server version: Apache/2.2.26 (Unix)
Server built: Dec 15 2013 18:33:29
I have installed mysql-5.6.20-osx10.7-x86_64.dmg.

Why php doesn't upgrade? What are the solutions?
Please, help me to solve this issue, but, please, give me a non-cryptic advice as I am a
newbie )
Thank you very much!

Alla

unread,
Jul 14, 2016, 11:03:27 AM7/14/16
to
<snip>
EDIT:
I have also did the following;

went to:
cd ; nano .bach_profile

put:
export PATH=/usr/local/php5/bin:$PATH

and then:
source ~/.bash_profile

Checked php -v again, and it is still 5.3

Jerry Stuckle

unread,
Jul 14, 2016, 11:03:46 AM7/14/16
to
At last - a PHP question (sort of)!

Did you restart Apache? And is your new version of PHP in the place
your LoadModule statement shows?

--
==================
Remove the "x" from my email address
Jerry Stuckle
jstu...@attglobal.net
==================

Alla

unread,
Jul 14, 2016, 11:08:47 AM7/14/16
to
ADDITION:
I have now did the following, and it shows a correct version:

/usr/local/php5/bin/php --version

PHP 5.5.37 (cli) (built: Jun 26 2016 13:53:04)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans

What shall I do to make sure that my system (apacher, mysql, phpmyadmin) use the correct
5.5 php version?
Thank you!

Alla

unread,
Jul 14, 2016, 11:14:07 AM7/14/16
to
On Thursday, July 14, 2016 at 7:03:46 PM UTC+4, Jerry Stuckle wrote:
> On 7/14/2016 10:57 AM, Alla wrote:
> > Hello!
> > I am trying to solve the issue I have with phpmyadmin, and I have found out that although
> > I have used curl -s http://php-osx.liip.ch/install.sh | bash -s 5.5 to upgrade, the php -v
> > command still shows that my version is php 5.3.28. I have checked httpd.conf, and the line
> > LoadModule php5_module libexec/apache2/libphp5.so is uncommented.
> >
> > My system: Mac OS X 10.7.5
> > Server version: Apache/2.2.26 (Unix)
> > Server built: Dec 15 2013 18:33:29
> > I have installed mysql-5.6.20-osx10.7-x86_64.dmg.
> >
> > Why php doesn't upgrade? What are the solutions?
> > Please, help me to solve this issue, but, please, give me a non-cryptic advice as I am a
> > newbie )
> > Thank you very much!
> >
>
> At last - a PHP question (sort of)!
>
> Did you restart Apache? And is your new version of PHP in the place
> your LoadModule statement shows?
>
Please, bear with me ) I am trying to start coding ) So I have to
finish this set up process.

Yes, I have restarted apache. Here:

Allas-MacBook-Pro:~ Alla$ sudo apachectl restart
Password:
Allas-MacBook-Pro:~ Alla$ php -v
PHP 5.3.28 with Suhosin-Patch (cli) (built: Jan 23 2014 20:55:45)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies

Still the same problem

Jerry Stuckle

unread,
Jul 14, 2016, 12:00:57 PM7/14/16
to
What about my other question - is your new version of PHP in the place
your LoadModule statement shows?

J.O. Aho

unread,
Jul 14, 2016, 12:26:43 PM7/14/16
to
Looking at the script, don't seem to have a proper version for OSX older
than 10.8.

You could first uninistall the PHP you have already installed and try
again and see if you get a working php or not, else just upgrade your
OSX till 10.8 or later and try again.


--

//Aho

Alla

unread,
Jul 14, 2016, 12:28:47 PM7/14/16
to
I am not sure if I have checked it correctly, but I see libphp5.so at the location
pointed to by LoadModule. Does it indicate that the correct version is at place?
Both versions start with 5:

Allas-MacBook-Pro:~ Alla$ cd /usr/libexec/apache2
Allas-MacBook-Pro:apache2 Alla$ ls
httpd.exp mod_dav.so mod_negotiation.so
libphp5.so mod_dav_fs.so mod_perl.so
mod_actions.so mod_dav_svn.so mod_proxy.so
mod_alias.so mod_dbd.so mod_proxy_ajp.so
mod_asis.so mod_deflate.so mod_proxy_balancer.so
mod_auth_basic.so mod_dir.so mod_proxy_connect.so
mod_auth_digest.so mod_disk_cache.so mod_proxy_ftp.so
mod_authn_anon.so mod_dumpio.so mod_proxy_http.so
mod_authn_dbd.so mod_env.so mod_proxy_scgi.so
mod_authn_dbm.so mod_expires.so mod_reqtimeout.so
mod_authn_default.so mod_ext_filter.so mod_rewrite.so
mod_authn_file.so mod_filter.so mod_scgi_pubsub.so
mod_authz_dbm.so mod_headers.so mod_setenvif.so
mod_authz_default.so mod_hfs_apple.so mod_speling.so
mod_authz_groupfile.so mod_ident.so mod_ssl.so
mod_authz_host.so mod_imagemap.so mod_status.so
mod_authz_owner.so mod_include.so mod_substitute.so
mod_authz_svn.so mod_info.so mod_unique_id.so
mod_authz_user.so mod_log_config.so mod_userdir.so
mod_autoindex.so mod_log_forensic.so mod_userdir_apple.so
mod_bonjour.so mod_logio.so mod_usertrack.so
mod_cache.so mod_mem_cache.so mod_version.so
mod_cern_meta.so mod_mime.so mod_vhost_alias.so
mod_cgi.so mod_mime_magic.so

Alla

unread,
Jul 14, 2016, 1:09:04 PM7/14/16
to
Now /usr/bin/php --version command shows correct version of php.
Below are the commands I performed. But when I try to download
http://localhost/~user/phpmyadmin/
I get the same message:

PHP 5.5+ is required.
Currently installed version is: 5.3.28

I don't understand how that all has happened given the fact that I have already
been at phpmyadmin login page, it just wouldn't let me in; now, I can't even access
that one )
All commands show that the correct php version is installed and is active; why apache
doesn't see it?

Allas-MacBook-Pro:~ Alla$ sudo mv /usr/bin/php /usr/bin/php5328
Allas-MacBook-Pro:~ Alla$ sudo ln -s /usr/local/php5/bin/php /usr/bin/php
Allas-MacBook-Pro:~ Alla$ which php
/usr/bin/php
Allas-MacBook-Pro:~ Alla$ /usr/bin/php --version

Jerry Stuckle

unread,
Jul 14, 2016, 1:23:10 PM7/14/16
to
Both 5.3.28 and 5.5.37 would have a libphp5.so module - it just shows
the major version. But the version which runs on the CLI is an
executable file, while the one which runs under Apache is a .so. They
are not the same thing, and it is entirely possible to have different
versions running - as you seem to have. Right now you are pointing at
the old version in your LoadModule statement.

I don't use a Mac, so I have no idea where your install script places
the PHP files. That's what you need to find out, and either have the
LoadModule in your Apache configuration point at that module, or move
the correct module to where your Apache configuration files points.

I echo J.O.'s recommendation to uninstall the old version (or better
yet, uninstall both versions) and install the new version.

And I would agree with J.O. - you should upgrade your OS, also. He
knows much more about Macs than I do.

Alla

unread,
Jul 16, 2016, 12:26:47 PM7/16/16
to
Thank you for your answers. I understand that it's risible to see how much time
it takes for me to set up php. Yes, my OS is obsolete, but I can't update
it now - not until I am better at understanding the way computers work )
I am currently involved in free online CS course, and learning C, and have started
php. I am afraid to reinstall my OS now because if anything goes wrong
I will not be able to fix that. But I will reinstall it in a while. For now I have to work
with what I have at hand )

I have reinstalled php two times; have configured apache, php, mysql.
Please, take a look at the description of how I have set up the new php version.

A few days ago I have set up phpmyadmin; the set up required an update of
preinstalled php version, which was 5.3.28. I have downloaded the 5.5.37, and
installed it.

curl -s http://php-osx.liip.ch/install.sh | bash -s 5.5

php –v command has revealed that the old 5.3.28 version was still active
and was in use; not the “new” 5.5.37 one.

- after searching and trying I finally got to the stage at which php -v
command shows a correct 5.5.37 version.

- but when I try to load http://localhost/~user/phpmyadmin/ I get the following message:

PHP 5.5+ is required.
Currently installed version is: 5.3.28

Here is how I go to php -v showing the correct version:

- I have installed mysql-5.6.20-osx10.7-x86_64.dmg.

- went to:
cd ; nano .bach_profile

- put:
export PATH=/usr/local/php5/bin:$PATH

- and then:
source ~/.bash_profile

- checked php -v again, and it was still 5.3

- then I used another check, which revealed a correct version:

/usr/local/php5/bin/php --version

PHP 5.5.37 (cli) (built: Jun 26 2016 13:53:04)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans

- I have restarted apache, still the same 5.3. version popped up:

sudo apachectl restart
Password:
php -v
PHP 5.3.28 with Suhosin-Patch (cli) (built: Jan 23 2014 20:55:45)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies

- then:

cd /usr/libexec/apache2
ls
httpd.exp mod_dav.so mod_negotiation.so
libphp5.so mod_dav_fs.so mod_perl.so
mod_actions.so mod_dav_svn.so mod_proxy.so
mod_alias.so mod_dbd.so mod_proxy_ajp.so
mod_asis.so mod_deflate.so mod_proxy_balancer.so
mod_auth_basic.so mod_dir.so mod_proxy_connect.so
mod_auth_digest.so mod_disk_cache.so mod_proxy_ftp.so
……………….

- and then I have done the following, and got the correct version:

sudo mv /usr/bin/php /usr/bin/php5328

sudo ln -s /usr/local/php5/bin/php /usr/bin/php

which php

/usr/bin/php

/usr/bin/php --version

PHP 5.5.37 (cli) (built: Jun 26 2016 13:53:04)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans

- tried to go to http://localhost/~user/phpmyadmin/, and got the same message:

PHP 5.5+ is required.
Currently installed version is: 5.3.28

Here are steps I took to set up AMP:

php –v

PHP 5.5.37 (cli) (built: Jun 26 2016 13:53:04)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans

httpd -v
Server version: Apache/2.2.26 (Unix)
Server built: Dec 15 2013 18:33:29

cd /etc/apache2
sudo nano httpd.conf

- checked if the following is uncommented, and it was:

LoadModule php5_module libexec/apache2/libphp5.so

- checked mysql version and got an error:

/usr/local/mysql/bin/mysql -v
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

- uninstalled mysql and installed it again; now I see mysql version:

/usr/local/mysql/bin/mysql -v

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 36
Server version: 5.6.20 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

- set a password and put Y everywhere required (I think it can't
effect php version, so I omit details):

sudo mysql_secure_installation
Password:

- next:

mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3784
Server version: 5.6.20 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> \q
Bye

- sudo apachectl configtest

httpd: Could not reliably determine the server's fully qualified domain name, using Users-MacBook-Pro.local for ServerName
Syntax OK

- http://localhost/~username/phpinfo.php
loads full php configuration page

- tried to get to http://localhost/~username/phpmyadmin/setup page
and still get the same message
PHP 5.5+ is required.
Currently installed version is: 5.3.28

Is it possible to help me on this issue?
Thank you very much for your understanding and patience!

J.O. Aho

unread,
Jul 17, 2016, 2:49:37 AM7/17/16
to
On 07/16/16 18:26, Alla wrote:
> On Thursday, July 14, 2016 at 8:26:43 PM UTC+4, J.O. Aho wrote:
>> On 07/14/16 16:57, Alla wrote:
>>> Hello!
>>> I am trying to solve the issue I have with phpmyadmin, and I have found out that although
>>> I have used curl -s http://php-osx.liip.ch/install.sh | bash -s 5.5 to upgrade, the php -v
>>> command still shows that my version is php 5.3.28. I have checked httpd.conf, and the line
>>> LoadModule php5_module libexec/apache2/libphp5.so is uncommented.
>>>
>>> My system: Mac OS X 10.7.5
>>> Server version: Apache/2.2.26 (Unix)
>>> Server built: Dec 15 2013 18:33:29
>>> I have installed mysql-5.6.20-osx10.7-x86_64.dmg.
>>>
>>> Why php doesn't upgrade? What are the solutions?
>>> Please, help me to solve this issue, but, please, give me a non-cryptic advice as I am a
>>> newbie )
>>> Thank you very much!
>>>
>>
>> Looking at the script, don't seem to have a proper version for OSX older
>> than 10.8.
>>
>> You could first uninistall the PHP you have already installed and try
>> again and see if you get a working php or not, else just upgrade your
>> OSX till 10.8 or later and try again.
>>
>
> Thank you for your answers. I understand that it's risible to see how much time
> it takes for me to set up php. Yes, my OS is obsolete, but I can't update
> it now - not until I am better at understanding the way computers work )
> I am currently involved in free online CS course, and learning C, and have started
> php.

Look at CS courses at edx.org, they have PHP based, they will provide
you with proper information to install the PHP they will be using. Sure
they may have requirement on your OSX version.


> I am afraid to reinstall my OS now because if anything goes wrong
> I will not be able to fix that. But I will reinstall it in a while. For now I have to work
> with what I have at hand )

As far as I know, you don't have to do a reinstall, just an upgrade,
sure it's good to make a backup with Time Machine before you make your
upgrade.

Alternatively you install virtualbox and install a Linux distribution
like Mint and use that virtual machine to do your php.


> I have reinstalled php two times; have configured apache, php, mysql.
> Please, take a look at the description of how I have set up the new php version.
>
> A few days ago I have set up phpmyadmin; the set up required an update of
> preinstalled php version, which was 5.3.28. I have downloaded the 5.5.37, and
> installed it.
>
> curl -s http://php-osx.liip.ch/install.sh | bash -s 5.5
>
> php –v command has revealed that the old 5.3.28 version was still active
> and was in use; not the “new” 5.5.37 one.

Your issue is that you have two versions installed on two different
locations, where the older ones path is before the newer ones path in $PATH.

Fix, just UNINSTALL the old version. You don't need it if you have a
newer version.


--

//Aho

Alla

unread,
Jul 21, 2016, 5:57:18 AM7/21/16
to
<snip>
Thank you very much for your suggestions.
I need to solve the problem within my system, and I am not ready to use VM, nor to
make my life easier by using additional apps like MAMP, and others like this (I know
you have not suggested those :) ).
I called on my courage and followed your main advice on upgrading to El Capitan. :)
Now i have the new OS, but the problem stays the same, because I have merely
upgraded to the new OS, not reinstalled it.

Now:

php –v shows 5.5.37 version

but http://localhost/~username/phpinfo.php shows 5.5.36 version

I assume there is not much difference, and both will do for my purposes;
but I do care to fix this, so not to have these multiple versions installed,
and to get rid of this mess I have created.

I think that 5.5.36 version comes with El Capitain, but 5.5.37 is the one
I have installed. As i have mentioned, I have performed a few steps to
get the command php -v show 5.5.37 version. Of course, I have no idea
how get back to php -v showing the original El Capitan's version, so then
I could delete 5.5.37 one (which I also have no idea how to do without the
risk of spoiling things yet again).

Could you, please, do me this huge favor and advise me on these issues?
You already see that I am very weak at this stuff yet.
Thank you very much!

Alla

unread,
Jul 21, 2016, 6:16:52 AM7/21/16
to
Additional information:
/usr/local/php5/bin/php --version also reveals 5.5.37 version. But apache
http://localhost/~username/phpinfo.php reads the 5.5.36 one from somewhere.

Just to show again how I got php -v command to show the 5.5.37 version
before upgrading to El Capitan:

Alla

unread,
Jul 21, 2016, 6:32:00 AM7/21/16
to
Reading http://localhost/~username/phpinfo.php I see that
Virtual Directory Support: Disabled

But when I was setting up apache today, I have added virtual hosts:

/etc/apache2/extra/httpd-vhosts.conf
<VirtualHost *:80>
ServerName localhost
DocumentRoot /Users/{username}/Sites/
</VirtualHost>

and uncommented in httpd.conf Include /private/etc/apache2/extra/httpd-vhosts.conf

Alla

unread,
Jul 21, 2016, 7:04:30 AM7/21/16
to
It seems that I have to change which version of php apache is using. I have found
this answer http://superuser.com/questions/969861/phpinfo-and-php-v-shows-different-version-of-php
but it is hard for me to understand. The author of the answer says:

"If for some reason you wanted to use a different version of PHP with Apache, all you
need to do is install the compiled Apache PHP module somewhere and add—or adjust—t
his line in your system’s Apache config:

LoadModule php5_module /path/to/php/and/the/module/for/apache2/libphp5.so

And just adjust the path to the libphp5.so—which is what Apache uses to parse PHP—
then restart Apache and you are in business."
Then he gives an example of how he has solved the same issue by just uncommenting
the certain load module line. Well, I don't understand how and where to get "the compiled
Apache PHP module"; what is path and how to "just adjust the path to the libphp5.so".
And in my httpd.conf I have only one php5 loadModule line, which doesn't show which
version of php apache is using:
LoadModule php5_module libexec/apache2/libphp5.so

At least I understand now that apache is using the older version, but I don't know
how to change this. I am sorry for so many messages on this trivial issue. Thank you
for your understanding!

Alla

unread,
Jul 21, 2016, 11:59:35 AM7/21/16
to
0 new messages