我在 Web 应用程序文件夹中获得了这些 php.ini 设置。
magic_quotes_gpc = Off;
register_globals = Off;
default_charset = "UTF-8";
memory_limit = 64M;
max_execution_time = 3600;
upload_max_filesize = 10M;
sql.safe_mode = Off;
mysql.connect_timeout = 20;
allow_url_fopen = Off;
session.auto_start = Off;
session.use_only_cookies = On;
session.use_cookies = On;
session.use_trans_sid = Off;
session.cookie_httponly = On;
session.gc_maxlifetime = 3600;
session.cookie_secure =On;
session.entropy_file = "/dev/urandom";
为了检查这些设置是否被强制执行,我将这些代码保存到文件 checksettings.php
<?php
if(get_magic_quotes_gpc())
echo "Magic quotes are enabled";
else
echo "Magic quotes are disabled";
echo '<br>';
echo 'Register Globals = ' . ini_get('register_globals');
echo '<br>';
echo 'Default Charset = ' . ini_get('default_charset');
echo '<br>';
echo 'Memory Limt = ' . ini_get('memory_limit');
echo '<br>';
echo 'Max Execution Time = ' . ini_get('max_execution_time');
echo '<br>';
echo 'Upload Max File Size = ' . ini_get('upload_max_filesize');
echo '<br>';
echo 'Sql Safe Mode = ' . ini_get('sql.safe_mode');
echo '<br>';
echo 'MySQL connect Timeout = ' . ini_get('mysql.connect_timeout');
echo '<br>';
echo 'Allow url fOpen = ' . ini_get('allow_url_fopen');
echo '<br>';
在我的网络浏览器上加载 checksettings.php 时,我得到了这些输出
Magic quotes are disabled
Magic Quotes =
Register Globals =
Default Charset = UTF-8
Memory Limt = 128M
Max Execution Time = 30
Upload Max File Size = 2M
Sql Safe Mode =
MySQL connect Timeout =
Allow url fOpen = 1
现在,据我所知,空白(Register Globals =,Sql Safe Mode = 等)是由于(我相信)语法错误(我会调查)但一些值不是我设置的他们是。
设置为 64M 的内存限制为 128M,设置为 3600 的最大执行时间为 30s,设置为 10M 的上传最大文件大小为 2M,设置为 0 或关闭的 Allow url fopen 为 1/on .
我做错了什么?
最佳答案
首先,您需要确保您正在编辑正确的 php.ini 文件:您可以使用 phpinfo() 文件检查 int。
<?php
phpinfo();
然后,修改右边的php.ini文件,然后重启webserver。
希望对您有所帮助。
关于Php ini 设置无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34454232/
我有一个Ruby程序,它使用rubyzip压缩XML文件的目录树。gem。我的问题是文件开始变得很重,我想提高压缩级别,因为压缩时间不是问题。我在rubyzipdocumentation中找不到一种为创建的ZIP文件指定压缩级别的方法。有人知道如何更改此设置吗?是否有另一个允许指定压缩级别的Ruby库? 最佳答案 这是我通过查看rubyzip内部创建的代码。level=Zlib::BEST_COMPRESSIONZip::ZipOutputStream.open(zip_file)do|zip|Dir.glob("**/*")d
我在从html页面生成PDF时遇到问题。我正在使用PDFkit。在安装它的过程中,我注意到我需要wkhtmltopdf。所以我也安装了它。我做了PDFkit的文档所说的一切......现在我在尝试加载PDF时遇到了这个错误。这里是错误:commandfailed:"/usr/local/bin/wkhtmltopdf""--margin-right""0.75in""--page-size""Letter""--margin-top""0.75in""--margin-bottom""0.75in""--encoding""UTF-8""--margin-left""0.75in""-
我在使用omniauth/openid时遇到了一些麻烦。在尝试进行身份验证时,我在日志中发现了这一点:OpenID::FetchingError:Errorfetchinghttps://www.google.com/accounts/o8/.well-known/host-meta?hd=profiles.google.com%2Fmy_username:undefinedmethod`io'fornil:NilClass重要的是undefinedmethodio'fornil:NilClass来自openid/fetchers.rb,在下面的代码片段中:moduleNetclass
我在我的项目目录中完成了compasscreate.和compassinitrails。几个问题:我已将我的.sass文件放在public/stylesheets中。这是放置它们的正确位置吗?当我运行compasswatch时,它不会自动编译这些.sass文件。我必须手动指定文件:compasswatchpublic/stylesheets/myfile.sass等。如何让它自动运行?文件ie.css、print.css和screen.css已放在stylesheets/compiled。如何在编译后不让它们重新出现的情况下删除它们?我自己编译的.sass文件编译成compiled/t
我对最新版本的Rails有疑问。我创建了一个新应用程序(railsnewMyProject),但我没有脚本/生成,只有脚本/rails,当我输入ruby./script/railsgeneratepluginmy_plugin"Couldnotfindgeneratorplugin.".你知道如何生成插件模板吗?没有这个命令可以创建插件吗?PS:我正在使用Rails3.2.1和ruby1.8.7[universal-darwin11.0] 最佳答案 随着Rails3.2.0的发布,插件生成器已经被移除。查看变更日志here.现在
我尝试运行2.x应用程序。我使用rvm并为此应用程序设置其他版本的ruby:$rvmuseree-1.8.7-head我尝试运行服务器,然后出现很多错误:$script/serverNOTE:Gem.source_indexisdeprecated,useSpecification.Itwillberemovedonorafter2011-11-01.Gem.source_indexcalledfrom/Users/serg/rails_projects_terminal/work_proj/spohelp/config/../vendor/rails/railties/lib/r
我正在查看instance_variable_set的文档并看到给出的示例代码是这样做的:obj.instance_variable_set(:@instnc_var,"valuefortheinstancevariable")然后允许您在类的任何实例方法中以@instnc_var的形式访问该变量。我想知道为什么在@instnc_var之前需要一个冒号:。冒号有什么作用? 最佳答案 我的第一直觉是告诉你不要使用instance_variable_set除非你真的知道你用它做什么。它本质上是一种元编程工具或绕过实例变量可见性的黑客攻击
我正在尝试在我的centos服务器上安装therubyracer,但遇到了麻烦。$geminstalltherubyracerBuildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingtherubyracer:ERROR:Failedtobuildgemnativeextension./usr/local/rvm/rubies/ruby-1.9.3-p125/bin/rubyextconf.rbcheckingformain()in-lpthread...yescheckingforv8.h...no***e
我花了三天的时间用头撞墙,试图弄清楚为什么简单的“rake”不能通过我的规范文件。如果您遇到这种情况:任何文件夹路径中都不要有空格!。严重地。事实上,从现在开始,您命名的任何内容都没有空格。这是我的控制台输出:(在/Users/*****/Desktop/LearningRuby/learn_ruby)$rake/Users/*******/Desktop/LearningRuby/learn_ruby/00_hello/hello_spec.rb:116:in`require':cannotloadsuchfile--hello(LoadError) 最佳
关闭。这个问题需要detailsorclarity.它目前不接受答案。想改进这个问题吗?通过editingthispost添加细节并澄清问题.关闭8年前。Improvethisquestion在首页我有:汽车:VolvoSaabMercedesAudistatic_pages_spec.rb中的测试代码:it"shouldhavetherightselect"dovisithome_pathit{shouldhave_select('cars',:options=>['volvo','saab','mercedes','audi'])}end响应是rspec./spec/request