简体   繁体   中英

Can't get php.ini changes to take effect

I am building a new WordPress website on a new testing server. The testing server using MAMP but is the Windows 7 version. 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. 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.

The file was generated by the WordPress export plugin and is 8.92M

I checked my php.ini file located at C:\\MAMP\\conf\\php5.6.21\\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?

Maybe the file you editing isn't getting loaded by 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.

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. I think you will have a similar path for your 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.

If that will not work out for you, could you please provide services' name running on your system?

Have a great day.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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