Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

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.

share|improve this answer
add comment

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

share|improve this answer
    
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 '12 at 12:01
add comment

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.

share|improve this answer
    
@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 '12 at 13:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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