开发者

How come my php settings on CLI and Apache are different? (OSX Lion Server) [closed]

Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 11 years ago.

Improve this question

I am currently setting up my New Mac Mini Lion server. I am now installing mongodb and apc extension. I want to include the ini settings for the extensions on the /etc/php.d directory (similar with my server settings on centOS)

I tried to do

php -i | grep php.d

and it gives me

Scan this dir for additional .ini files => /etc/php.d/
Additional .ini files parsed => /etc/php.d/apc.ini,
/etc/php.d/mongo.ini
PHP_INI_SCAN_DIR => /etc/php.d/
_SERVER["PHP_INI_SCAN_DIR"] => /etc/php.d/

But when I tried on phpinfo() on a php script, I got:

Configuration File (php.ini) Path   /etc
Loaded Configuration File   /private/etc/php.ini
Scan this dir for additional .ini files     (none)
Additional .ini files parsed    (none) 

The php environment on CLI and php script is the same which php

/usr/bin/php

and on php script page

PATH /usr/bin:/bin:/usr/sbin:/sbin

Is there anything I should set on the apache side?

I am thinking to stick with the Built-in apache and php from the mac installation because I lik开发者_如何学编程e the Server App from Mac.

Please help me.

Thank You


I just did this the other night, although it was not on Lion Server.

sudo nano /etc/apache2/httpd.conf

uncomment (delete the #)

#LoadModule php5_module   libexec/apache2/libphp5.so

save with ctrl+o then Enter

then restart apache

sudo apachectl restart -t

Additionally, you will need to

cd /etc
sudo cp php.ini.default php.ini
sudo chmod 666 php.ini

I would also recommend configuring php.ini (basically every module is disabled).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜