0

I'm getting a well known error from the question title. The problem is, website is running on a shared server and I don't have access to php.ini file.

I've set `php_value memory_limit' inside .htaccess to higher value.

I've set WP_MEMORY_LIMIT inside wp_config.php to higher value.

phpinfo() says that max_execution_time is set to 30 and safe_mode is off.

My question is, can I change something inside my WordPress installation to make my website work? I've read about set_time_limit. Can it help me somehow, or the only solution is to move onto another server?

3 Answers 3

1

You can simply create a text file and call it php.ini . Make sure the file has the text encoding "Unicode no BOM", as that will work best for both linux and windows. Use an FTP client to make a new file on the server and that will generate a file with the correct permissions and text encoding.

Put just this line in it:

memory_limit = 64M

But that will not raise your memory allocation if the host doesn't allow individual php.ini files in accounts which override the server php.ini, which sounds like is the case, since they don't allow .htaccess to override the server. And it's doubtful they will change your php.ini file for you.

Usually bumping memory in wp-config.php is sufficient, and there's no need to edit .htaccess. Many hosts allow individual php.ini files. You're on a very restrictive host. I'd change hosts.

1

If you create a 'php.ini' and it makes no difference, then it is very likely that changing wp_config or changing your .htaccess will also have no impact.

Best suggestion is to contact your Hosting Provider and ask them to modify your php.ini

1
  • I've already contacted my hosting provider, and they said they can't change anything for security reasons... And about creating my own php.ini, I haven't tried it, and I don't know how to build this file. Is there some generator online with default values or something like that?
    – smogg
    Oct 4, 2012 at 12:01
0

Going off of what @Damien mentioned, if you open up your wp-config.php file and add-in:

define('WP_MEMORY_LIMIT', '96M');

Create an info.php file on your server, have it in the root of your site (so you can access it at http://YOURDOMAIN.COM/info.php and add the following in it:

<?php

phpinfo();

Try loading up that info.php file before and after you make that wp-config addition. Do a search on the page for memory_limit. Does that value change? If not, then yes, you may be stuck in the mud with your host.

1
  • @smogg and zach try this BUT DELETE THE FILE AS SOON AS. A file like this is a walking security disaster waiting to happen.
    – Damien
    Oct 4, 2012 at 13:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.