English 中文(简体)
Need to increase PHP memory_limit for specific directory NOT entire server
原标题:

I m running wordpress 2.8.6 as fcgi with safe_mode=on, on plesk9/centOS64. wordpress was installed by installatron. php.ini is being read from /etc/etc/php.ini

I need to increase php s memory_limit, because I get many mod_fcgid: stderr: PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 40961 bytes) in /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/blah/blah.php on line X when I try to upgrade most WP plugins.

Following instructions on http://www.sakinshrestha.com/wordpress/fix-php-fatel-error-for-wordpress/, i tried creating both a php.ini and an htaccess file and placing it in /var/www/vhosts/domain.com/httpdocs/wp-content/. It didnt work. I did not try using both files at the same time. apache was restarted each time i created those files.

I thought not being able to use the setting per folder could be due to the fact that I am using fcgi. I switched the domain to use mod_php. Now when I try to upgrade a plugin I get a box asking for FTP login info (as seen in http://www.chrisabernethy.com/why-wordpress-asks-connection-info/). I put in the correct FTP login info, but when I click continue, the server tries to get me to download update.php.

So now i have two questions:

1) how do i increase memory_limit for that folder only under FCGI?

2) how do i switch to mod_php and configure WP to NOT need FTP connection info? I tried following the instructions in the last link above, but <?php echo(exec("whoami")); ?> is blocked by PHP Warning: exec() has been disabled for security reasons in /var/www/vhosts/domain.com/httpdocs/whoami.php on line 3. i turned safe_mode=off but it didnt make a difference.

arrrrghhhhh!!

最佳回答

As of PHP 5.3 you can use .user.ini as an configuration file per User.

Best wishes,
Fabian

问题回答

Why in wp-content? Try creating a php.ini in /var/www/vhosts/domain.com/httpdocs.

Also, did you edit wp-settings.php? This is the default:

if ( !defined( WP_MEMORY_LIMIT ) )
    define( WP_MEMORY_LIMIT ,  32M );




相关问题
Using SimplePie with CodeIgniter and XAMPP

I am using CodeIgniter 1.7.2 with XAMPP 1.7.2 on a Windows computer. I am trying to make use of SimplePie. I followed all the instructions I could find: a copy of simplepie.inc is in my applications/...

Multiple Sites with common files

I have developed over 50 sites that all use the exact same files other than CSS and IMAGES, I currently duplicate the files each time I create a new site and upload different css and images. What ...

http server validation

I finish a litle http server, writing from scratch. I would like to be sure that my imlementation is conforme to the HTTP specifications. W3C give us tools for HTML/XML conformance, but i see nothing ...

热门标签