LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 01-29-2004, 09:37 AM   #1
Gilion
Member
 
Registered: Sep 2003
Location: Netherlands
Distribution: Debian 3.0
Posts: 78

Rep: Reputation: 15
PHP4 MySQL configuration


I'm creating website using databases, so I've started installing the required components. I was using apache and php before, so I only needed to ad MySQL. In debian that's easy:

apt-get install mysql-server php4-mysql libapache-mod-auth-mysql
apache restart

Then proceeding to testing I took a bit of code using mysql_connect() which gives a undefined function error if not proceeded by dl("mysql.co").

I like to set up my server so I don't need the dl line, the documentation of php4-mysql tells me to include a line in php4.ini saying: extension=mysql.so. However: cat /etc/php4/apache/php4.ini | grep mysql tells me this line is already in the php4.ini file.

Now I don't know how to move on?
 
Old 01-29-2004, 03:11 PM   #2
ricstirato
Member
 
Registered: Jan 2004
Location: Gießen, Germany
Distribution: Xubuntu 12.04, Mythbuntu, Ubuntu Server 12.04
Posts: 174

Rep: Reputation: 24
Is the extension line for mysql commented out? There should no semicolon as the first character.
If there is, remove it.

Did you restart Apache after installing php4-mysql?

BTW: you don't need mod_auth_mysql, this is only if you want apache to authenticate against a MySQL database.
 
Old 01-30-2004, 06:19 AM   #3
Gilion
Member
 
Registered: Sep 2003
Location: Netherlands
Distribution: Debian 3.0
Posts: 78

Original Poster
Rep: Reputation: 15
The extension line isn't commented out and apache is restarted. I double checked on those.

Thanks for the remark on mod_auth_mysql, I will remove it.

Any other suggestions?
 
Old 01-30-2004, 10:46 AM   #4
looseCannon
Member
 
Registered: Dec 2003
Location: Little Rock, AR
Distribution: Fedora Core 2, AIX, HP-UX, Solaris, Whitebox
Posts: 193

Rep: Reputation: 31
Not that familiar with Debian, but I'll take a shot in the dark. Is PHP compiled with MySQL support? I know when I compile it I have to add the --with-mysql option to the configure script. Maybe it isn't and that's why you're having to do the dl thing.
 
Old 01-30-2004, 12:58 PM   #5
Gilion
Member
 
Registered: Sep 2003
Location: Netherlands
Distribution: Debian 3.0
Posts: 78

Original Poster
Rep: Reputation: 15
In debian php comes precompiled in a *.deb package. MySQL isn't compiled in, but provided with module loaded in the dl command. I'd like this module to be linked at boottime, which is why I'm trying to do it this way. Is compiling with mysql support necessary?
 
Old 01-30-2004, 03:20 PM   #6
looseCannon
Member
 
Registered: Dec 2003
Location: Little Rock, AR
Distribution: Fedora Core 2, AIX, HP-UX, Solaris, Whitebox
Posts: 193

Rep: Reputation: 31
On RedHat 7.x and above and SuSE 8.2 I've had to pass the option in the configuration script to compile with mysql support. If I didn't then using mysql commands did like you're experiencing before you do the dl thing. But as long as I compiled with the mysql support I didn't have to do anything to use mysql functions.
 
Old 01-30-2004, 03:25 PM   #7
ricstirato
Member
 
Registered: Jan 2004
Location: Gießen, Germany
Distribution: Xubuntu 12.04, Mythbuntu, Ubuntu Server 12.04
Posts: 174

Rep: Reputation: 24
Compiling in MySQL support is equivalent to installing the php-mysql extension and adding the line to php.ini, which is usually done during installation of the MySQL extension. You also stated it is there.

The only idea I have at the moment is that your php.ini is not parsed by your PHP on Apache startup.
Just to be sure, install another extension, check it is enabled as extension in php.ini and try to use it.

In case this also does not work: do you use Debian's standard Apache and PHP packages or did you get them elsewhere and/or compile them yourself? Are there any other php.ini on your system (updatedb; locate php.ini - the first one will take some time)?
 
Old 02-02-2004, 11:03 AM   #8
Gilion
Member
 
Registered: Sep 2003
Location: Netherlands
Distribution: Debian 3.0
Posts: 78

Original Poster
Rep: Reputation: 15
This doesn't work as well..., same problem. There is only one php.ini at my system after changing the example one's name. No difference after Apache reboot?

Do you know of the existence of a multiple line spanning comment statement in php.ini? Anyone with other suggestions?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache configuration problems with PHP4 ID10T_error Linux - Software 1 08-16-2005 08:58 PM
PHP4-MySQL TehIan Linux - Software 2 06-30-2005 02:51 PM
php4 mysql, installation, php-pages with mysql info stay empty dnla Linux - Software 2 03-14-2004 03:54 PM
php4 mysql connectivity bm1 Programming 4 02-19-2004 07:23 PM
mysql support in php4.3-dev chr15t0 Linux - General 1 12-10-2002 11:06 AM


All times are GMT -5. The time now is 06:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration