Le lun 06/01/2003 à 06:35, Paul Gregg a écrit :
> > perl -pi -e "s|^;extension=mysql.so|extension=mysql.so|" /etc/php.ini
> > Is there a quick and easy way to do this kind of thing in PHP? Or would
> I was about to say "Ask the RPM makers" until I saw who was asking :-)

Everyone's doing that.. RedHat, SuSe, PLD, Mandrake... so obviously no
RPM guy has ever tried something else ;-)

> How about:
> php -q -r '$lines=file("/etc/php.ini"); $f=fopen("/etc/php.ini", "w"); \
> foreach ($lines as $line) { fwrite($f, preg_replace("/^;extension=mysql.so/",\
> "extension=mysql.so", $line)); } fclose($f);'

I'll try that, thanks!

> I presume perl is no longer a "standard" package installed with either
> redhat or mandrake thus the question ?

No, it's just that it's pretty weird to have a Prereq: perl in a PHP
package. Imagine the irony, you install the best scripting language
(PHP) and you need its competitor (Perl) to be able to use install it
;-)

Jean-Michel


--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to