在Symfony2的修复要求 [英] Fixing requirements in Symfony2
问题描述
我做了我的机器上安装的Symfony2
I've made a Symfony2 installation on my machine.
当我检查我的本地URL的要求:
When I check the requirements in my local url:
localhost/Symfony2/web/config.php
它说:
主要问题
设置date.timezone在php.ini *设置(如欧洲/巴黎)。
Set the "date.timezone" setting in php.ini* (like Europe/Paris).
建议
在php.ini中设置short_open_tag的值为关闭*。
Set short_open_tag to off in php.ini*.
magic_quotes_gpc的设置为关中
php.ini中*。
Set magic_quotes_gpc to off in php.ini*.
- 更改为php.ini文件必须以/etc/php5/apache2/php.ini来完成。
我做了无论是在 /etc/php5/apache2/php.ini
和的/ etc / PHP5 / CLI /所需的更改的php.ini
:
date.timezone =欧洲/马德里
date.timezone = "Europe/Madrid"
short_open_tag的值为=关
short_open_tag = Off
magic_quotes_gpc的=关
magic_quotes_gpc = Off
两者 short_open_tag的值为
和 magic_quotes_gpc的
,其中已被设置为关闭,当我检查在php.ini文件。
Both short_open_tag
and magic_quotes_gpc
where already set to Off when I checked the php.ini files.
我已经重新启动的Apache2后:
After that I've restarted apache2:
sudo service apache2 restart
不过,我仍然得到同样的错误消息。
However I still get the same error messages.
我用Symfony的2.1.2,Ubuntu的12.04和PHP 5.3.6
I use Symfony 2.1.2, Ubuntu 12.04 and PHP 5.3.6
更新
如果我运行在浏览器的phpinfo(),它说加载的配置文件它位于:
If I run phpinfo() from the browser, it says the Loaded Configuration File it's located in:
/etc/php5/apache2/php.ini
如果我跑 PHP -i | grep的php.ini文件
它说加载的配置文件它位于:
If I run php -i | grep php.ini
it says the Loaded Configuration File it's located in:
/etc/php5/cli/php.ini
这些是我已经做了修改两个文件。
These are the two files where I've already made the changes.
我确信更改已保存在文件中。我也有使用phpinfo()函数在PHP文件并在浏览器中执行它。它说,为date.timezone值不设置,并且magic_quotes_gc和short_open_tag的值为设置为开。
I've made sure that the changes have been saved in the file. I also have used phpinfo() in a php file and executed it in the browser. It says that the values for date.timezone are not set, and magic_quotes_gc and short_open_tag are set to On.
如果我执行 PHP应用程序/ check.php
,要求都解决了,所以我想,的/ etc / PHP5 / CLI / PHP。 INI
它的正常工作,并且只有与 /etc/php5/apache2/php.ini
的一个问题,这是与工作之一浏览器。
If I execute php app/check.php
, the requirements are resolved, so I suppose that /etc/php5/cli/php.ini
it's working correctly and there is only a problem with /etc/php5/apache2/php.ini
, which is the one that works with the browser.
推荐答案
您已经取得应该解决您的问题,如果做得正确的变化;双重检查。确保实际被保存更改。很多时候,当我编辑在Ubuntu的php.ini文件,我忘了运行与正确的权限编辑器(根),并错过了警告,该文件无法保存。此外,通过从脚本中调用phpinfo()函数验证所做的更改。
The changes you have made should fix your problem if done correctly; double check that. Make sure the changes are actually being saved. Many times when I edit php.ini files in Ubuntu I forget to run the editor with the right permissions(root) and miss the warning that the file could not be saved. Also, verify the changes by calling phpinfo() from a script.
你得到相同的结果,当你运行位于从终端应用程序/ check.php的纸条。从项目的根目录:
Do you get the the same result when you run the scrip located in app/check.php from the terminal. From project root:
php app/check.php
如果仍然有问题,所有我可以建议是清除缓存;与Symfony2的很多问题都解决了这种方式。
If still having problem, all I can suggest is clearing the cache; with symfony2 a lot of problems are solved that way.
这篇关于在Symfony2的修复要求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!