简体   繁体   English

无法使php.ini更改生效

[英]Can't get php.ini changes to take effect

I am building a new WordPress website on a new testing server. 我正在新的测试服务器上构建新的WordPress网站。 The testing server using MAMP but is the Windows 7 version. 测试服务器使用MAMP,但它是Windows 7版本。 The server is running great and the site is fine, but I'm trying to import an xml file with posts, into the new site. 服务器运行良好,站点很好,但是我正在尝试将带有帖子的xml文件导入新站点。 I get the following error: 我收到以下错误:

Sorry, there has been an error. 抱歉,出现错误。 File is empty. 文件为空。 Please upload something more substantial. 请上传更重要的内容。 This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini. 此错误也可能是由于您的php.ini文件中的上传功能被禁用或post_max_size文件的大小小于php.ini文件中的upload_max_filesize文件所导致的。

The file was generated by the WordPress export plugin and is 8.92M 该文件由WordPress导出插件生成,为892万

I checked my php.ini file located at C:\\MAMP\\conf\\php5.6.21\\php.ini 我检查了位于C:\\ MAMP \\ conf \\ php5.6.21 \\ php.ini的php.ini文件

I updated the lines as follows: 我将这些行更新如下:

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
;upload_tmp_dir =

; Maximum allowed size for uploaded files.
upload_max_filesize = 32M


; Maximum number of files that can be uploaded via a single request
max_file_uploads = 40

But it still does not show the new values when I try to update the file it still says there are only 2M instead of the new 32M? 但是当我尝试更新文件时,它仍然不显示新值,它仍然说只有2M而不是新的32M?

Maybe the file you editing isn't getting loaded by PHP. 也许您编辑的文件没有被PHP加载。

Run the following command to see which configuration file is loaded. 运行以下命令以查看加载了哪个配置文件。

php -i | grep php.ini

Or try phpinfo() function to get the correct file path. 或者尝试使用phpinfo()函数来获取正确的文件路径。

Then apply your changes and restart the server. 然后应用您的更改并重新启动服务器。

I had similar issue some time. 我曾经有过类似的问题。 I had resolved the problem by editing php.ini file located at /etc/php5/cli/php.ini in Linux environment. 我已经通过在Linux环境中编辑/etc/php5/cli/php.ini中的php.ini文件解决了该问题。 I think you will have a similar path for your WAMP. 我认为您将为WAMP使用类似的方法。 Otherwise, you may be running another web server like IIS, Nginx or Apache etc. Please make sure that there is not another web server running on your Windows 7 environment. 否则,您可能正在运行其他Web服务器,例如IIS,Nginx或Apache等。请确保Windows 7环境中没有运行其他Web服务器。

If that will not work out for you, could you please provide services' name running on your system? 如果那对您不可行,请您提供系统上运行的服务名称吗?

Have a great day. 祝你有美好的一天。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM