简体   繁体   English

在FTP中使用php.ini更改max_execution_time

[英]change max_execution_time with php.ini in FTP

I'm using WP All Import to load in product to my websites, but I keep getting error messages when importing larger files. 我正在使用WP All Import将产品加载到我的网站中,但是在导入较大的文件时,我一直收到错误消息。 The biggest one (150,000+ products) causes a 500 internal server error. 最大的一个(超过150,000个产品)导致500个内部服务器错误。 The smaller ones a few thousand products each just cause errors with the plugin and I need to restart the import process from where it left off. 较小的几千个产品每个都会导致插件错误,我需要从中断处重新开始导入过程。 I think my php.ini limits may need increasing. 我认为我的php.ini限制可能需要增加。 According to WP All Import plugin my current server limits are: 根据WP All Import插件,我当前的服务器限制为:

upload_max_filesize 8M upload_max_filesize 8M

post_max_size 16M post_max_size 16M

max_execution_time -1 (What does -1 mean, I've tried Google without any helpful results. Is it unlimited?) max_execution_time -1 (-1是什么意思,我试过Google并没有任何有益的结果。它不受限制吗?)

max_input_time 60 max_input_time 60

I've tried a suggestion from another stackoverflow user that recommended placing the following in my .htaccessfile, but it doesn't seem to have done the job. 我尝试了另一个stackoverflow用户的建议,建议将以下内容放在我的.htaccess文件中,但似乎没有完成这项工作。 The plugin still shows the same limits and the errors are still happening. 插件仍然显示相同的限制,并且错误仍在发生。 But as it's done from the .htaccess file I am unsure if it will reflect the changes in the plugin, or how to know if it's had any effect at all. 但是由于它是从.htaccess文件完成的,因此我不确定它是否会反映插件中的更改,或者不确定如何知道它是否有任何效果。

<IfModule mod_php5.c>
php_value post_max_size 200M
php_value upload_max_filesize 200M
php_value memory_limit 300M
php_value max_execution_time 259200
php_value max_input_time 259200
php_value session.gc_maxlifetime 1200
</IfModule>

The other solution I read about was to insert a php.ini in my websites root folder, I found some resources that said I need to change my .htaccess file and include: 我读到的另一种解决方案是在网站的根文件夹中插入php.ini,我发现一些资源需要更改.htaccess文件,其中包括:

<Files php.ini>
order allow,deny
deny from all
</Files>

and

<IfModule mod_suphp.c>
suPHP_ConfigPath /home/username/public_html
</IfModule>

but doesn't give very clear instruction on what to put inside the php.ini itself. 但是没有明确说明如何在php.ini中放入内容。 Can anyone help? 有人可以帮忙吗?

Thank you. 谢谢。

You can't only change the file via FTP. 您不仅可以通过FTP更改文件。 You have to restart your server process after updating the PHP.ini. 您必须在更新PHP.ini之后重新启动服务器进程。

Depending on your server you should be able to restart the server process using command such as: sudo service apache2 restart . 根据您的服务器,您应该能够使用以下命令来重新启动服务器进程: sudo service apache2 restart (in case you are using Apache and not PHP-FPM/Nginx etc..). (如果您使用的是Apache,而不是PHP-FPM / Nginx等。)

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

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