LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 09-24-2003, 11:28 AM   #1
NW Otter
LQ Newbie
 
Registered: Sep 2003
Distribution: Mandrake
Posts: 27

Rep: Reputation: 15
php.ini


I have installed Apache/MySQL/php on a Mandrake dist using RPMDrake. When trying to access the database through php, I get the "Call to Undefined function" error.

I think I have traced this to the fact that I do not seem to have a php.ini file in the correct place. Using kFind, I have found 2 sample php.ini files...

So I guess I copy and rename one of these to the apache directory, right? Am I on the right track and where can I find some documentation on this step?
 
Old 09-24-2003, 11:47 AM   #2
NW Otter
LQ Newbie
 
Registered: Sep 2003
Distribution: Mandrake
Posts: 27

Original Poster
Rep: Reputation: 15
Aha!! I found it at

http://www.php.net/manual/en/install.apache2.php
 
Old 09-24-2003, 12:49 PM   #3
NW Otter
LQ Newbie
 
Registered: Sep 2003
Distribution: Mandrake
Posts: 27

Original Poster
Rep: Reputation: 15
Damm. Still does not work. I copied the file to /usr/local/lib as noted in the docs, but I don't think this is the correct location. Any hints on where it should be in a Mandrake dist?
 
Old 09-24-2003, 01:03 PM   #4
NW Otter
LQ Newbie
 
Registered: Sep 2003
Distribution: Mandrake
Posts: 27

Original Poster
Rep: Reputation: 15
Okay, the blog continues. Hopefully this will help prevent some poor soul from floundering as badly as I.

After looking at the phpinfo( ) output, I see the Configuration File Path entry says "/etc" .

I hope this means the etc directory off the root... there are so many it is very confusing.
 
Old 09-24-2003, 01:53 PM   #5
NW Otter
LQ Newbie
 
Registered: Sep 2003
Distribution: Mandrake
Posts: 27

Original Poster
Rep: Reputation: 15
Okay... some progress. Now the phpinfo Configuration File Path says "/etc/php.ini". So now I know that it is reading the configuration file.

But I still get the "Call to Undefined function" error when making a call to mysql_connect. So now I have to figure out how to get the php-mysql libraries installed, I guess. Any input is welcome.
 
Old 09-24-2003, 02:16 PM   #6
NW Otter
LQ Newbie
 
Registered: Sep 2003
Distribution: Mandrake
Posts: 27

Original Poster
Rep: Reputation: 15
So I thought that maybe I do not have the libraries installed so I checked this:

[root@localhost root]# rpm -qa | egrep "php|httpd|sql"
apache2-mod_php-2.0.44_4.3.1-2mdk
postgresql-server-7.3.2-5mdk
libphp_common430-430-11mdk
postgresql-7.3.2-5mdk
libmysql12-4.0.11a-5mdk

Any suggestions on where my problem is? I'm kind of concerned that I don't see a mysql entry here, but I can run mysql from the command line and interact with it. Maybe apache does not know it is there or something?
 
Old 09-24-2003, 03:22 PM   #7
NW Otter
LQ Newbie
 
Registered: Sep 2003
Distribution: Mandrake
Posts: 27

Original Poster
Rep: Reputation: 15
Did a KFind Contents search for the string php4_module...

Nothing.

So now I notice that I have two httpd configuration files, etc/httpd/conf/httpd2.conf (this one looks to be where I should find the configuration file) and usr/share/ADVX/compat/httpd.conf.

So now the questions are, which file do I modify and where are the php4 libraries located?

I think I will start a blog titled 'The trials of the Otter and the Penguin'.

I quess my main error here was assuming that the mandrake rpmdrake interface would install and configure this stuff. It has been difficult to figure out what has been done and what has not. Windows for all it's faults does tend to spoil you.
 
Old 09-24-2003, 03:41 PM   #8
NW Otter
LQ Newbie
 
Registered: Sep 2003
Distribution: Mandrake
Posts: 27

Original Poster
Rep: Reputation: 15
Did a search for libphp4.so...

Nothing.

Searched for libphp4*...

Nothing.

I guess php can be installed without these library files installed???
 
Old 09-24-2003, 03:44 PM   #9
NW Otter
LQ Newbie
 
Registered: Sep 2003
Distribution: Mandrake
Posts: 27

Original Poster
Rep: Reputation: 15
By the way, here is the configure that the mandrake install used, I'll bet I should look at this, eh?

'./configure' '--prefix=/usr' '--libdir=/usr/lib' '--enable-discard-path' '--disable-force-cgi-redirect' '--enable-shared' '--disable-static' '--disable-debug' '--disable-rpath' '--enable-pic' '--enable-inline-optimization' '--enable-memory-limit' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php' '--with-pear=/usr/share/pear' '--enable-magic-quotes' '--enable-debugger' '--enable-track-vars' '--with-exec-dir=/usr/bin' '--with-versioning' '--with-mod_charset' '--with-regex=php' '--enable-track-vars' '--enable-trans-sid' '--enable-safe-mode' '--enable-ctype' '--enable-ftp' '--with-gettext=/usr' '--enable-posix' '--enable-session' '--enable-sysvsem' '--enable-sysvshm' '--enable-yp' '--with-openssl=/usr' '--without-kerberos' '--with-ttf' '--with-freetype-dir=/usr' '--with-zlib=/usr' '--with-zlib=/usr' '--with-zlib-dir=/usr'
 
Old 09-24-2003, 03:57 PM   #10
NW Otter
LQ Newbie
 
Registered: Sep 2003
Distribution: Mandrake
Posts: 27

Original Poster
Rep: Reputation: 15
Went into rpmdrake. At first I could not find anything in the list that was close, but then I noticed the radio buttons at the top and switched from Mandrake choices to All Packages, alphabetical. Now I see php-mysql-4.3.0-2.mdk. Looks promising, but I am a little worried that this is not the latest version...
 
Old 09-24-2003, 04:42 PM   #11
NW Otter
LQ Newbie
 
Registered: Sep 2003
Distribution: Mandrake
Posts: 27

Original Poster
Rep: Reputation: 15
Didn't work. I wish I could figure out where I can run configure. So far, I can't seem to run it from anywhere.
 
Old 09-24-2003, 08:17 PM   #12
NW Otter
LQ Newbie
 
Registered: Sep 2003
Distribution: Mandrake
Posts: 27

Original Poster
Rep: Reputation: 15
Fixed!!!

I searched the forum on mandrake and mysql. After reading many posts, I came across this gem posted by FlyingSmurf:

I had a similar problem, had everything necessary installed from the 9.1 CD's yet php couldn't talk to mysql!!

This is how I fixed it: in /etc/php there's a 34_mysql.ini file that says 'extension = mysql.so'

I replaced mysql.so to the exact location of the file /usr/lib/php/extensions/mysql.so


This did the trick.

In addition, haobaba1 had this comment:

I had a similar problem when I installed apache, php, mysql on mandrake 9.1. First off the the install notes instructed me to move the php.ini to an incorrect directory it should be in /etc or /etc/php and in the php.ini file the modules_ext(something similar to this) variable was =./ this would have been correct for the directory they tell you to move the php.ini file to not for the directory it should be in. You should move the php.ini file to either of the correct directories I mentioned and then change the variable to point to where ever it is that mysql.so and all your other modules are located.



Thanks guys!
 
  


Reply



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
php5 apache2 mysql4 don't work, php does not seem to read php.ini atom Linux - Software 5 03-24-2005 11:05 AM
Upgraded PHP from 4.3.4 to 4.3.10 and now it won't read php.ini gregmcavoy Linux - Software 11 01-22-2005 12:16 PM
php: different mail server from php.ini rayds Programming 0 09-14-2004 03:48 AM
I need help with php.ini Wagner Programming 2 10-14-2003 05:14 AM
where is php.ini? ShawnD Linux - Software 6 07-24-2002 10:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:08 AM.

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
Open Source Consulting | Domain Registration