PHP error

PHP error

by Abhishek Sharma -
Number of replies: 6

HI,

I'm trying to install moodle on ubuntu server i got the screen of installation , the next screen where it checks for the software requirement it gives me this error,

Server checks

Name Information Report Status
php
version 5.2.8 is required and you are running 5.2.4.2.5.17version 5.2.8 is required and you are running 5.2.4.2.5.17 Check

But the problem is That i've updated my php on server to 5.2.8 and also tried by updating it to 5.3.3 as well , but it still takes the same old version ,

Now i checked that the php on the server is updated by :

:~# php -v
PHP 5.2.8 (cli) (built: May 20 2011 13:04:25)
Copyright (c) 1997-2008 The PHP Group

---------------------------------------------------------------------------

:~#php5 -v
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613+lfs/memcache.so' - /usr/lib/php5/20060613+lfs/memcache.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613+lfs/imap.so' - /usr/lib/php5/20060613+lfs/imap.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613+lfs/ldap.so' - /usr/lib/php5/20060613+lfs/ldap.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613+lfs/mhash.so' - /usr/lib/php5/20060613+lfs/mhash.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.2.4-2ubuntu5.17 with Suhosin-Patch 0.9.6.2 (cli) (built: May  4 2011 09:46:14)
Copyright (c) 1997-2007 The PHP Group

---------------------------------------------------------------------------------------------------------------------------

I feel that there are two php packages on the server and the moodle is taking the 5.2.4 pacakage as default , i'm not sure if this makes sense or not sad .
But the error it says that required 5.2.8 version php and the current version is 5.2.4, but i did upgrade to 5.2.8. I'm not sure which file needs to be edited for this , i have no much idea on PHP

Any help would be appreciated!

Average of ratings: -
In reply to Abhishek Sharma

Re: PHP error

by Guillermo Madero -

Yes, you seem to have two php installations.

If you are using the Apache web server, under the "conf" directory you should find a "httpd.conf" file; open it and search for the PHPIniDir directive, it should have the path to the folder where php.ini is located (e.g. PHPIniDir "/path/to/php").

In reply to Guillermo Madero

Re: PHP error

by Abhishek Sharma -

Hi Guillermo,

I appreciate your reply , But as i'm on live and remote server that is ubuntu 8.04 the httpd.conf file is blank and even in README file i did not find much information ...so would you be able to brief me some more guidence step what can be done to sort this issue please ?

But I used "find " and i've found the php.ini location - '/etc/php5/apache2/php.ini
' but i couldnot find anything that i can change ....I'm not that good in php and linux internals ...

In reply to Abhishek Sharma

Re: PHP error

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
That's the standard setup for Apache and PHP on Ubuntu. It differs from the default locations that would be used if you compiled PHP from source (for example).

The PHP CLI (what you get if you type php at the command line) is a completely different binary from the PHP that Apache uses. However, they would normally be the same, so it seems someone has loaded a newer version of the CLI at some point.

However, this is a "red herring". The CLI version doesn't matter as far as Moodle is concerned. You need a newer web-served version. As I said in my other post, by far the easiest way to do this is to install a newer version on Ubuntu.
In reply to Abhishek Sharma

Re: PHP error

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
What version of Ubuntu is this and how was PHP installed in the first place... AND how are you trying to install the newer version.

Ubuntu packages install PHP and Apache in all sorts of strange places. There's nothing wrong with that except that if you then come along and build your own you either need to remove the Ubuntu versions completely or match the file paths exactly.

To be honest, I would upgrade your server to a newer Ubuntu - 10.10LTS will do the trick.
In reply to Howard Miller

Re: PHP error

by Abhishek Sharma -

Hi Howard , Thanks for the reply .

The current ubuntu servers version is 8.04 and earlier the PHP was installed of 5.2.4 now i tried to upgrade it by using apt-get upgrade php which did not go well so i downloaded a php-5.2.8-src and unzipped it and used apt-get install the php also tried with (./configure , make , make install )

 

Now i got the same thought of removing all the php versions and reinstalling a new one but as this is a live servers i dont have permissions to do that ..now i'm struck sad

In reply to Abhishek Sharma

Re: PHP error

by Guillermo Madero -

Maybe you could contact the server administrator and see if they can do the required system upgrade.