Bug 75033 - PHP mysql_connect error with RedHat 8 MySQL, Apache, PHP server install
PHP mysql_connect error with RedHat 8 MySQL, Apache, PHP server install
Product: Red Hat Linux
Classification: Retired
Component: mysql (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Patrick Macdonald
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2002-10-03 16:57 EDT by Need Real Name
Modified: 2007-04-18 12:47 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-11-14 12:59:21 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2002-10-03 16:57:44 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020830

Description of problem:
Standard RedHat 8 server install with Apache 2.0.40, PHP 4.2.2-8.0.5 and MySQL
3.23.52-3 enabled does not permit connection to MySQL.  I have used the same
test scripts on RedHat 7.x with no problems, but I seem to remember having to
select mysql-devel, php-devel, and apache-devel on install in the 7.x distros. 
I was hoping that RedHat 8 installed these by default if Apache, MySQL, and PHP
were selected as I did during this install. Why does phpinfo() return the
configuration command  --with-mysql=shared,/usr instead of --with-mysql-enabled
as before?  What packages do I need to install to get this triad to work
properly?  I now that this is not just a problem with one server since I have
two servers with the same exact problem.

The error is as follows:
Fatal error: Call to undefined function: mysql_connect() in
/var/www/html/php_scripts/connect_test.php on line 8

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.Install RedHat 8 with Web services, SQL services (with MySQL checked under
"Details"); Standard install
2.Create test db in MySQL with proper permissions and call db with
mysql_connect() via php script.

Actual Results:  
Fatal error: Call to undefined function: mysql_connect() in
/var/www/html/php_scripts/connect_test.php on line 8

Expected Results:  Should have connected to db just fine.  I use a test script
to check connectivity before I install my regular db and php scripts.

Additional info:

See Above
Comment 1 Need Real Name 2002-10-04 16:55:56 EDT
The problem is solved by installing php-mysql-4.2.2-8.0.5.  This needs to 

be included in the anaconda install selections when php, mysql, and 

apache are all selected.

Let me know when this issue is resolved.

Michael Thomas

Comment 2 Need Real Name 2002-10-31 13:07:06 EST
I had this problem as well.  The php-mysql-4.2.2-8.0.5. RPM set me straight. 
Thanks for your work in finding the sollution.

Ben Dugdale
Comment 3 Joern 2002-11-14 12:59:14 EST
I have the same problem, where can I find the above RPM (php-mysql-4.2.2-8.0.5) ??
Comment 4 Joe Orton 2002-12-12 07:32:25 EST
It's on the third 8.0 CD.
Comment 5 Need Real Name 2003-05-07 00:08:23 EDT
Adding this rpm fixed the problem for me as well.  It took me a while to figure
out how to do it.  I tried using the Packages GUI, but php-mysql did not show up
there.  I finally was successful by inserting the 8.0 CD #3 and running 'rpm -i
RedHat/RPMS/php*' as root from the /mnt/cdrom directory.

Note You need to log in before you can comment on or make changes to this bug.