0

I know enabling PHP is as easy as uncommenting

LoadModule php5_module libexec/apache2/libphp5.so in /etc/apache2/httpd.conf

but is there any way of doing this in a single unix command?

Like: find LoadModule php5_module libexec/apache2/libphp5.so and remove the # before it IF there is a comment.

Thanks!

4

2 回答 2

0

尝试这个 :

sed -i -r 's@^# *(LoadModule php5_module.*)@\1@' /etc/apache2/httpd.conf
于 2013-08-25T14:12:49.957 回答
0

这就是我修复它的方法:

sudo sed -i '' 's/#LoadModule php5_module/LoadModule php5_module/g' /etc/apache2/httpd.conf
于 2013-08-25T16:48:06.453 回答