You are not logged in.

#1 2005-03-10 21:24:57

gaboo
Member
From: Lyon/France
Registered: 2005-03-06
Posts: 10

Pb using mysql with php

I currently have apache/php/mysql installed.

[root@gaboo /]# pacman -Qi | grep apa
apache 2.0.53-2
[root@gaboo /]# pacman -Qi | grep mysql
mysql 4.1.10-1
[root@gaboo /]# pacman -Qi | grep php
php 5.0.3-5

But when I tried to make a mysql connection, I get

Fatal error: Call to undefined function mysql_connect() in /home/httpd/gg/pageprincipale.php on line 16

Moreover, when I display this php page :

<?php phpinfo(); exit(); ?>

I don't have a mysql section, displaying its settings.

The mysql extension is built-in into php5, everything seems at the right place, I can't find why it doesn't work.

Any ideas ?  :?:

Offline

#2 2005-03-10 21:28:25

RedShift
Member
From: Belgium
Registered: 2004-07-16
Posts: 230

Re: Pb using mysql with php

try mysqli (www.php.net/mysqli)


:?

Offline

#3 2005-03-10 23:46:22

neri
Forum Fellow
From: Victoria, Canada
Registered: 2003-05-04
Posts: 552

Re: Pb using mysql with php

gaboo wrote:

I don't have a mysql section, displaying its settings.

The mysql extension is built-in into php5, everything seems at the right place, I can't find why it doesn't work.

Any ideas ?  :?:

uncomment the extension=mysql.so from /etc/php.ini

-neri

Offline

#4 2005-03-12 14:13:52

gaboo
Member
From: Lyon/France
Registered: 2005-03-06
Posts: 10

Re: Pb using mysql with php

Are there someone who succeed using php/mysql with the packages provided by arch ?

Because it seems that both mysqli and mysql are compiled although they aren't compatible.

I'm going to compile php myself to try.

Offline

#5 2005-03-12 15:06:40

neri
Forum Fellow
From: Victoria, Canada
Registered: 2003-05-04
Posts: 552

Re: Pb using mysql with php

gaboo wrote:

Are there someone who succeed using php/mysql with the packages provided by arch ?

Because it seems that both mysqli and mysql are compiled although they aren't compatible.

I'm going to compile php myself to try.

did you uncomment this line from php.ini ?

-neri

Offline

#6 2005-03-12 18:05:50

gaboo
Member
From: Lyon/France
Registered: 2005-03-06
Posts: 10

Re: Pb using mysql with php

Ok, it works now.
I had several problems on my system.

Moreover, the line wasn't commented, but I added it at the end of the config file. But it wasn't working this way.

Anyway, it's ok now.

Thanks !

Offline

#7 2005-07-14 03:55:57

uberGeek
Member
From: Near Chicago
Registered: 2004-01-07
Posts: 65
Website

Re: Pb using mysql with php

Hey!  Thanks for posting your solution to get it working.  I'm sure it's helped many others over come the same or similar problems.


carb $ now; uname -a; uptime
Sun 03Jul11 14:54:25 CDT -0500
Linux carb 2.6.17-ARCH #1 SMP PREEMPT Fri Jul 7 09:15:53 CEST 2006 i686 Pentium III (Coppermine) GenuineIntel GNU/Linux
14:54:25 up 1463 days,  9:24,  1 user,  load average: 1.00, 1.00, 1.00

Offline

#8 2005-07-18 21:25:10

rinzai
Member
From: Sofia || München || Garching
Registered: 2005-03-04
Posts: 21

Re: Pb using mysql with php

Gee...I had a similar problem...The thing was I had uncommented extension=mysql.so... :shock:

An upgrade from php 5.0.3 to 5.0.4 did the trick...so just as a sidenote:
you might experience problems with php 5.0.3-3 / mysql 4.1.12-1


Being able to read someone else's code is a *good thing*. Not a fundamental right.

Offline

#9 2005-07-18 23:42:37

uberGeek
Member
From: Near Chicago
Registered: 2004-01-07
Posts: 65
Website

Re: Pb using mysql with php

I had to uncomment:

extension=mysql.so

AND THEN edit it to:

extension=mysqli.so

Working great now.

Now that MySQL is working I've started playing with GD in PHP, cool stuff.


carb $ now; uname -a; uptime
Sun 03Jul11 14:54:25 CDT -0500
Linux carb 2.6.17-ARCH #1 SMP PREEMPT Fri Jul 7 09:15:53 CEST 2006 i686 Pentium III (Coppermine) GenuineIntel GNU/Linux
14:54:25 up 1463 days,  9:24,  1 user,  load average: 1.00, 1.00, 1.00

Offline

#10 2005-09-26 03:48:57

Shofs
Member
From: Central Illinois
Registered: 2004-12-15
Posts: 184

Re: Pb using mysql with php

uberGeek wrote:

I had to uncomment:

extension=mysql.so

AND THEN edit it to:

extension=mysqli.so

Working great now.

Now that MySQL is working I've started playing with GD in PHP, cool stuff.

That didn't work for me. I don't have a MySQL section when I go to a phpinfo() page.


EDIT: Thingsare working now. MySQLi is now in the phpinfo().

Offline

#11 2005-10-05 00:09:11

usedtire
Member
Registered: 2004-02-12
Posts: 50

Re: Pb using mysql with php

Not working for me. 

I recently upgraded everything on my server using pacman and now I get the mysql_connect() error.  I made sure the extension was uncommented.  Restarted httpd, but still nothing.  Funny thing is phpMyAdmin works fine.

Odd thing is that all my MySQL passwords no longer work. I had to break into MySQL.  ah, the joys of learning things over.

Offline

#12 2005-10-05 02:12:03

usedtire
Member
Registered: 2004-02-12
Posts: 50

Re: Pb using mysql with php

THis is just plain dumb.  I had to create this link

ln -s /usr/lib/php/extensions/no-debug-non-zts-20041030/mysql.so /usr/lib/php/mysql.so

to get it to work. 

WHY?? 

It works, but how often do I need to this?  Everytime Pacman upgrades?

Offline

#13 2005-10-05 03:01:43

Shofs
Member
From: Central Illinois
Registered: 2004-12-15
Posts: 184

Re: Pb using mysql with php

I thought I read somewhere about someone compiling PHP with support for both  MySQL and MySQLi. If that is possible I think we should do that because some PHP apps don't work with MySQLi yet.

Any thoughts?

Offline

#14 2005-10-12 15:05:33

Victor
Member
From: Zaragoza/ESPAÑA (Spain)
Registered: 2005-01-27
Posts: 23

Re: Pb using mysql with php

usedtire wrote:

THis is just plain dumb.  I had to create this link

ln -s /usr/lib/php/extensions/no-debug-non-zts-20041030/mysql.so /usr/lib/php/mysql.so

to get it to work. 

WHY?? 

It works, but how often do I need to this?  Everytime Pacman upgrades?

Instead, you can change the line:

extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20041030/"

of your /etc/php.ini file


http://aur.archlinux.org
[code][Victor]
Server = http://personales.ya.com/vmromanos/arch/pkgs
[/code]
http://vmromanos.homelinux.net/foro

Offline

#15 2005-10-12 15:57:42

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,615
Website

Re: Pb using mysql with php

Yeah. I am not happy with the way some of the arch packages are being packaged lately. It seems as time passes, I am having to build more and more of the packages myself after customizing the build. Which is fine...if you like gentoo.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

Board footer

Powered by FluxBB