Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 04-17-2008, 07:51 AM   #1
LQ Newbie
Registered: Apr 2008
Distribution: debian
Posts: 19

Rep: Reputation: 0
private (non-root) apache2 has no mysql in php

i built my own apache2 and installed it into my home directory. after changing th port to 8000 it worked and ich could see my pages. so i added a loadmodule entry in my apache config files for having php.
that worked too.
i've installed both php and php-mysql as ordinary package from the main debian etch servers but now php says that he cant find the mysql_connect() function. but there i NO php.ini file on my system which has no entry!
how can that be? php just HAS to read the php.ini files eiter /etc/php4/cgi/php.ini or my ~/.php.ini cause of the enviroment variable PHPRC="/home/test/.php.ini"
just where does my apache2 gets an php version without mysql? doesnt he use the php-cgi/php4-cgi program? could i change the program he uses?
if i type

php4-cgi /home/test/apache2/htdocs/test.php >./test.html
iceweasel ./test.html
there is the right page which is using mysql correctly.

can anyone help me?
Old 04-21-2008, 08:20 AM   #2
LQ Newbie
Registered: Mar 2008
Posts: 5

Rep: Reputation: 0
The php function phpinfo() is pretty useful for figuring out how your php environment looks to apache. Create a tiny script called test.php and put the following lines in it:




It will tell you which php.ini file its using and which modules you're using.

As an aside, regarding the mysql_connect error message, it sounds like you may be using the mysqli module vs the older mysql module without knowing it. But perhaps someone else can correct me on this.....?
Old 04-22-2008, 07:10 AM   #3
LQ Newbie
Registered: Apr 2008
Distribution: debian
Posts: 19

Original Poster
Rep: Reputation: 0
good idea

thanks for your reply, i never knew phpinfo says which php.ini file php is using. i'll try this. but i just cant understand why php is working WITH mysql when i install apache2 as debian package from the main package pool.
why does php do something other whn it is called by my self-compiled apache.
i've tried to use the file from my main apache, and the private server seems to use it (or could it be that i didnt knew apache is using a builtin php module?).


apache22, mysql, php4, phpini

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
Install Apache2, PHP 5, & MySQL 5 Blake M. Linux - Server 4 10-17-2007 02:01 PM
MySQL PHP Apache2 on Debian Stormrage Debian 2 07-16-2006 03:02 PM
sarge 3.1, Apache2, php and mysql rblampain Debian 4 12-17-2005 12:03 AM
SuSE 10.0, Apache2, MySQL, PHP ? petelogan SUSE / openSUSE 4 10-28-2005 10:14 AM
AS 3 w/ PHP, MySQL, and Apache2 pollardw Red Hat 1 02-23-2004 08:47 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:15 PM.

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