如何启用山狮php.ini并使其发挥作用? [英] How to enable php.ini in Mountain Lion and make it work?

查看:148
本文介绍了如何启用山狮php.ini并使其发挥作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是山狮。

我在制作会议在PHP工作中的问题。默认情况下,没有/etc/php.ini中所以我复制/etc/php.ini.default。

I'm having problems making sessions work in PHP. By default, there is no /etc/php.ini so I copied /etc/php.ini.default.

sudo cp /etc/php.ini.default /etc/php.ini

现在,我没有做与php.ini中任何事情。我重启apache只是为了测试。

Now, I'm not doing anything with php.ini yet. I restart apache just to test.

sudo apachectl restart

浏览我的本地站点,它显示了PHP code,而不是跨preTED HTML。如果我删除/etc/php.ini中(然后再重新启动Apache的)后,该网站再度被正确呈现。

Browsing my local site, it shows the PHP code, and not the interpreted HTML. If I delete /etc/php.ini (and after restarting apache again), the site gets rendered correctly again.

phpinfo()函数显示php.ini文件位于/ etc文件夹。

phpinfo() shows php.ini is located at /etc folder.

我的根目录是/库/ Web服务器/文件。我不想使用设置,让我使用Web根目录

My webroot is /Library/WebServer/Documents. I don't want to use the setup the webroot that lets me use

http://localhost/~username.

我AP preciate你的帮助。谢谢你。

I appreciate your help. Thanks.

推荐答案

我想通了。 short_open_tag的值为设置为关闭,我是用项short_open_tags。我刚刚得知,项short_open_tags现在不可取的。

I figured it out. short_open_tag is set to off and I was using short_open_tags. I just learned that short_open_tags are not advisable now.

http://machiine.com/2013/how-to-enable-and-setup-php-ini-on-a-mac-with-osx-10-8-mamp-part-4/帮助了我。

这篇关于如何启用山狮php.ini并使其发挥作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆