Can't Install MySQL with PHP


 
Thread Tools Search this Thread
Top Forums Web Development Can't Install MySQL with PHP
# 1  
Old 08-12-2013
Can't Install MySQL with PHP

Hi,

I'm on a Raspberry Pi with Raspbian Wheezy.

I urgently need to get MySQL running with PHP, but I get an error.
For example:
Code:
$con=mysql_connect("127.0.0.1","root","******","ids");

gives
Code:
PHP Fatal error:  Call to undefined function mysql_connect()

So, I found I needed to install some packages to get PHP working with MySQL but they all 404 like so:

Code:
root@raspberrypi:/var/www/note/framework# apt-get install php5-mysql
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libasound2-dev libavahi-common-dev libcaca-dev libdirectfb-extra libelf1 libglib2.0-bin libglib2.0-dev libpcre3-dev libpcrecpp0 libpng12-dev libpthread-stubs0
  libpthread-stubs0-dev libpulse-mainloop-glib0 libslang2-dev libts-dev libxau-dev libxcb1-dev libxdmcp-dev x11proto-core-dev x11proto-input-dev x11proto-kb-dev
  x11proto-xext-dev xorg-sgml-doctools xtrans-dev
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
  php5-mysql
0 upgraded, 1 newly installed, 0 to remove and 168 not upgraded.
Need to get 68.8 kB of archives.
After this operation, 220 kB of additional disk space will be used.
Err http://mirrordirector.raspbian.org/raspbian/ wheezy/main php5-mysql armhf 5.4.4-14
  404  Not Found
Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/p/php5/php5-mysql_5.4.4-14_armhf.deb  404  Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

and

Code:
root@raspberrypi:/var/www/note/framework# apt-get install php5-mysqlnd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libasound2-dev libavahi-common-dev libcaca-dev libdirectfb-extra libelf1 libglib2.0-bin libglib2.0-dev libpcre3-dev libpcrecpp0 libpng12-dev libpthread-stubs0
  libpthread-stubs0-dev libpulse-mainloop-glib0 libslang2-dev libts-dev libxau-dev libxcb1-dev libxdmcp-dev x11proto-core-dev x11proto-input-dev x11proto-kb-dev
  x11proto-xext-dev xorg-sgml-doctools xtrans-dev
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
  php5-mysqlnd
0 upgraded, 1 newly installed, 0 to remove and 168 not upgraded.
Need to get 150 kB of archives.
After this operation, 413 kB of additional disk space will be used.
Err http://mirrordirector.raspbian.org/raspbian/ wheezy/main php5-mysqlnd armhf 5.4.4-14
  404  Not Found
Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/p/php5/php5-mysqlnd_5.4.4-14_armhf.deb  404  Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Can anybody help?

Freddy

EDIT: I have run apt-get update.
# 2  
Old 08-12-2013
404 error has nothing to do with the operating system or its configuration but with the repository where you're trying to fetch the file from.

Try using a different mirror.

If you don't want to mess with Aptitude and its repos, you can also download the package by hand and install it with dpkg.

Here's a mirror that has the file but there may be many others.
# 3  
Old 08-12-2013
I know what a 404 error is Smilie it just seemed unlikely that a major repository wouldn't have such a major package.

Your mirror worked, anyway, thanks Smilie

Freddy
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. HP-UX

How to install Mysql on HP-UX?

Gd afternoon I am trying to run my website made in php-mysql on a HP-UX system but dont know how to install and run services of Mysql. Kindly provide appropriate solution for installing mysql on HP-UX system. thanks in advance. (1 Reply)
Discussion started by: kumar.ashishcs
1 Replies

2. Emergency UNIX and Linux Support

Migration of website... PHP/Mysql -which path for DB.php

Hi, I have two websites: website1.com and website2.com I didn't write either but have successfully moved all the files from website1.com to website2.com I (thought) I installed all the correct php modules and website2 is mostly up and running. However, my boss found that when we go to a... (15 Replies)
Discussion started by: Astrocloud
15 Replies

3. Linux

How To Install and configure Mysql for CRM with PHP

Hi , I have tired several times and tried a lot to install CRM in Centos Linux i686 but while im opening in browser for installing it shows database error as Unable to connect to database Server. Invalid mySQL Connection Parameters specified This may be due to the following reasons:... (0 Replies)
Discussion started by: babinlonston
0 Replies

4. Ubuntu

Not able to install mysql in ubuntu11.10

where should i download mysql-server package from? (2 Replies)
Discussion started by: srinathk
2 Replies

5. Red Hat

I want to install/compile php with mysql.

I have removed php-5.1.6-27.el5 from our system. Because I installed it without mysql before. How can I install php together with mysql. # rpm -qa | grep mysql* libdbi-dbd-mysql-0.8.1a-1.2.2 mysql-5.0.77-4.el5_4.2 mysql-server-5.0.77-4.el5_4.2 mysql-connector-odbc-3.51.26r1127-1.el5 ##... (5 Replies)
Discussion started by: getrue
5 Replies

6. Linux

make command problem with MySql install

Hi, hopefully someone can help me. I am trying to set up LAMP on Fedora 11 starting with MySql. I downloaded the mysql-5.1.40.tar.gz tarball and unpacked it all. This created the mysql-5.1.40 directory. Next I ran the ./configure command. Following this I ran the make command to compile but... (2 Replies)
Discussion started by: patcom
2 Replies

7. AIX

MYSQL Install on AIX

Hello All: I've been asked to install mysql on AIX box and I have very little experience in UNIX. Does anybody have any step by step directions on installing MYSQL? Any guidance would be appreciated! Thanks (1 Reply)
Discussion started by: rmnv
1 Replies

8. AIX

Install MySQL connector without local SQL database

Hello UNIX gurus, I need to install the mysql odbc connector with unixODBC on my AIX 5.3 machine. I have a mySQL database running on another server (Ubuntu 7.04). The SQL database works fine. The problem I am having is when trying to run ./configure for mysql-connector-odbc it seems to be looking... (1 Reply)
Discussion started by: raidzero
1 Replies

9. UNIX for Dummies Questions & Answers

PHP & Apache & MySQL install how-to ?

how do i install php & mysql with apache on suse linux ??? apache was installed and configured when i installed linux. all its files are in different folders. e.g http files in usr/local/httpd/htdocs/ and its configs are in etc/httpd/ so how do i install php and get it to work with apache and... (4 Replies)
Discussion started by: perleo
4 Replies
Login or Register to Ask a Question