Bug 72074

Summary: php-mysql is not enabled when installing it
Product: [Retired] Red Hat Linux Reporter: Florin Andrei <florin>
Component: phpAssignee: Phil Copeland <copeland>
Status: CLOSED NOTABUG QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-08-20 23:32:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Florin Andrei 2002-08-20 23:32:39 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.5 (X11; Linux i686; U;) Gecko/20020606

Description of problem:
After upgrading to php-4.1.2-7.2.3, my web application stopped working (no MySQL
API in PHP).
The solution was to edit by hand /etc/php.ini and add this line:

extension=mysql.so


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


How reproducible:
Always

Steps to Reproduce:
1.upgrade to latest php
2.install php-mysql
3.run a web application that uses mysql
	

Actual Results:  there's no mysql support in php

Expected Results:  mysql stuff should work fine

Additional info:

Workaround: edit /etc/php.ini and add:

extension=mysql.so

Instead, the php-mysql package should add itself automatically.

Comment 1 Phil Copeland 2002-08-31 06:58:37 UTC
From the spec file.


################################################################################
# mysql ########################################################################
#
%files mysql
        %defattr(-,root,root)
        %{_libdir}/php4/mysql.so


%post mysql
        if %{__grep} -q "extension=mysql.so" %{_sysconfdir}/php.ini; then
                %{__perl} -pi -e "s|^;extension=mysql.so|extension=mysql.so|" %{
_sysconfdir}/php.ini
        else
                %{__perl} -pi -e "s|^;extension=php_mysql.dll|;extension=php_mys
ql.dll\nextension=mysql.so|" %{_sysconfdir}/php.ini
        fi

%preun mysql
        if [ $1 = 0 -a -f %{_sysconfdir}/php.ini ] ; then
          %{__perl} -pi -e "s|^extension=mysql.so|;extension=mysql.so|" %{_sysco
nfdir}/php.ini
        fi



the section that concerns actions after installing the file (%post) look for the
line ';extension=mysql.so' in the php.ini file
If it finds it, it will remove the ';' The assumption is that
'extension=mysql.so' exists in the php.ini file. If you did not have it present
in your default /etc/php.ini file then no action is taken. This can occur when
upgrading because it is policy to NOT remove or overwrite a configuration file
with a new one, consequently we cannot guarentee what is or is not in the
previous /etc/php.ini file. Note in the errata that we do ask that you carefully
look over your /etc/php.ini file specifically for this reason.