notquiteageek
Posts: 8
Joined: Sun Sep 30, 2012 9:23 am
Location: Uk

PHP mysql problem

Sun Sep 30, 2012 9:43 am

I'm trying to set up a LAMP system on my Pi. To start with I did not know about apt-get etc. so I started compiline apache, mysql and PHP. Along the way I found

sudo apt-get install php5-mcrypt

on php.net.

It seemed to install a good apache2 and php. After a bit of configuration it seemed ok but I have a problem. The mysql.so doesn't load with this error. My original compilations are all in /usr/local/apache so should not conflict.

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525+lfs/mysql.so' - /usr/lib/php5/20100525+lfs/mysql.so: undefined symbol: mysqlnd_connect in Unknown on line 0

I've tried installing using

sudo apt-get install mysql-server but I get 404 errors like this:

http://mirrordirector.raspbian.org/rasp ... -7_all.deb

Is there anything else that I can try

Thanks

User avatar
stevepdp
Posts: 285
Joined: Fri Oct 28, 2011 7:41 am
Contact: Website Twitter

Re: PHP mysql problem

Sun Sep 30, 2012 11:43 am

Perhaps the easiest way to install Apache, PHP and MySQL on a Debian/Raspbian system is by using the tasksel tool.

If it's not already installed, you can install it by running the command:

Code: Select all

sudo apt-get install tasksel
Once it's installed, run it like so:

Code: Select all

sudo tasksel
You'll see an ncurses interface with a list of desktop and server roles to deploy, the one you want is the LAMP server. Simply select it, hit OK and it should install and configure all the necessary packages.

plugwash
Forum Moderator
Forum Moderator
Posts: 3614
Joined: Wed Dec 28, 2011 11:45 pm

Re: PHP mysql problem

Sun Sep 30, 2012 12:22 pm

Please run apt-get update && apt-get upgrade to make sure you have the latest packages.

If you still have the problem after doing that please report back so we can do some more in-depth debugging.

notquiteageek
Posts: 8
Joined: Sun Sep 30, 2012 9:23 am
Location: Uk

Re: PHP mysql problem

Sun Sep 30, 2012 1:54 pm

Great to know about tasksel. It's a bit of a blunt instrument but I've got nothing against keeping it simple. Lamp server is not an option on wheezy it seems.

Every time I've run it I'm getting "apt-get failed (100)". I haven't investigated deeply yet but I'm guessing it is encountering some of the same 404 errors that I'm getting running apt-get install independantly.

I will run apt-get update && apt-get upgrade but I'm not expecting much change as I only installed them yesterday. I downloaded the OS 6 days ago.

I'm very happy to help with development on this. My own php compilation seems to work without the same mysql.so error so far. I'm trying to install phpMyAdmin and I've got the mysqli problem back that I managed to fix yesterday with the standard installation. Just gotto remember how :)

I'll get back with any updates...

notquiteageek
Posts: 8
Joined: Sun Sep 30, 2012 9:23 am
Location: Uk

Re: PHP mysql problem

Sun Sep 30, 2012 5:15 pm

I did the following
apt-get install php5-mysqlnd
apt-get install php5-mysql

The second one seemed to supercede the first but after that the original error disappeared. This is what I get for an apache2 restart now

[Sun Sep 30 16:45:44 2012] [notice] caught SIGTERM, shutting down
[Sun Sep 30 16:45:46 2012] [notice] Apache/2.2.22 (Debian) PHP/5.4.4-7 configured -- resuming normal operations

I am receiving some new SD cards next week so I'll start again to hopefully provide more useful feedback

Return to “Raspberry Pi OS”