WordPress.org

Ready to get started?Download WordPress

Forums

Can't find php.ini (11 posts)

  1. jackfussell
    Member
    Posted 7 years ago #

    I'm trying to change the max file upload setting which I thought was in php.ini....but I can't find it now. I changed it on my other blogs which are running 2.1.3 but on 2.2 I can't find it. Where do I change this setting?

  2. MichaelH
    Member
    Posted 7 years ago #

    php.ini is not a WordPress file.

    See: http://us.php.net/ini.core

  3. wireless
    Member
    Posted 6 years ago #

    Hi there I just copied this from a responce found on an internal hosts Q&A forum a problem that I had which the info below fixed for me....

    Why does my PHP script fail with ‘Fatal error: Allowed memory size of 8388608 bytes exhausted’?

    Print Now Email Now

    PHP has a built-in limit on the amount of memory it will allocate. If that limit is reached, the process will exit with this error message. This is usually the result of the PHP script trying to load a large file, such as an image, into memory all at once. While it is better if you can arrange for the script not to do such things, it is also possible to increase the memory limit some to avoid this problem. To do that, edit the php.ini file with your PHP scripts (create it if it does not exist) and add the following line:
    memory_limit=16M

    You should replace the ‘16′ with whatever value is appropriate. The default is 8M (8 megabytes, the 8388608 bytes from the error message). ”

    ….and if it isnt there …

    “You could create the file in a simple text program such as notepad, save it as php.ini and upload it to your public_html folder.”

    hope this helps it did me!!!!!!!!!!

  4. ClaytonJames
    Member
    Posted 6 years ago #

    found on an internal hosts Q&A forum

    I'm a little confused. If I am not mistaken, php.ini is a server-side configuration file with a general location (in a Linux distribution) of;

    /etc/php.ini, or maybe /etc/php(version)/php.ini, depending on the distro.

    I don't believe you would have access to this unless you own the server on which your site is hosted. Does this thread confuse the actual php.ini configuration file with a similar file present in a WordPress installation? ...and does the above information imply that the basic php configuration files located on a hosts server can be overridden by the placement of a "php.ini" file in a users WordPress installation folder? I hope what is being refered to is what is defined in php.ini "Resource Limits".

    max_execution_time = 30; Maximum execution time of each script, in seconds
    max_input_time = 60; Maximum amount of time each script may spend parsing request data
    memory_limit = 16M; Maximum amount of memory a script may consume

    (these settings are from "php recommended", by the way)

    I am assuming (and we all know what happens when we do that!), that no matter what you place in your public folder, you should not be able to alter the maximum resource limit settings defined by your host in "php.ini. On the other hand, if you own the server, just "sudo"- favorite editor- /path/to/file, and have at it! Could someone with additional insight please tell me if my thinking is on track? Sorry if this is a little off topic, but if there is a WordPress file or feature or php file that can make this happen, I would be greatfull to be aware of it. Thanks!

    (going to go get a beer and pull up the man pages for php)!

  5. whooami
    Member
    Posted 6 years ago #

    If I am not mistaken, php.ini is a server-side configuration file with a general location (in a Linux distribution) of;

    /etc/php.ini, or maybe /etc/php(version)/php.ini, depending on the distro.

    Thats generally correct.

    I don't believe you would have access to this unless you own the server on which your site is hosted.

    Thats not neccessarily true. A fair amount of hosts allow you to use your own php.ini. Somewhat remarkably, one of the most talked about (in a bad way) hosts on these forums, GoDaddy, for instance, allows this. As does my regular host, A Small Orange.

    In other words, some hosts allow them to be customizable by the user, some dont.

    Does this thread confuse the actual php.ini configuration file with a similar file present in a WordPress installation? ...

    No.

    ...and does the above information imply that the basic php configuration files located on a hosts server can be overridden by the placement of a "php.ini" file in a users WordPress installation folder?

    Yes, see above, with the following correction (There is one misspeak in what you asked) - your php.ini needs to be in the root of your web accessable directory. That means if your blog is inside a sub directory named wordpress/ your php.ini needs to be located one directory up (that ought to be your web root).

  6. ClaytonJames
    Member
    Posted 6 years ago #

    You have just achieved my "Hero for the day" status, for what ever that might be worth! :-) I am certainly willing to slog through my php docs, and Google is my friend ...sort-of... but do you remember offhand if the feature that controls this option is likely to be related to a "cgi.redirect" directive? Either way, thanks for the reply.
    Just when you think you have a handle on something, huh?

    Cheers!

  7. whooami
    Member
    Posted 6 years ago #

    do you remember offhand if the feature that controls this option is likely to be related to a "cgi.redirect" directive?

    controls what option?

  8. whooami
    Member
    Posted 6 years ago #

    oh, are you asking if allowing or disallowing of a unique php.ini in a user's directory is related to allowing a "cgi.redirect"? Whatever that is ..I know of similar terms, and there are things like cgi aliases, that relate to Apache installs... Is that what you are asking about?

  9. ClaytonJames
    Member
    Posted 6 years ago #

    I do apologize, I tend to get ahead of myself. I quickly made the assumption (see what happens?), that the settings that support user specific or custom php.ini files, may be a quick and dirty alteration of a directive contained in /etc/php.ini. I use php in module mode on my test server (obviously no need to share beyond my own network, save for an occasional browser test), and a little quick boning up tells me that it may... or may not... I'm still reading, require running php in CGI mode with Suexec to enable execution of user defined php settings. For the time being, getting Suexec to work with PHP and my virtual host settings is beyond my current level of need as well as perhaps my current level of comprehension. (Not to mention unrelated to WordPress). However, this thread has sent me in a welcomed new direction (my bookmark is already hanging out of my php manual)!

    ...and to others with this concern: check with your hosting company and see if they allow you to create custom php.ini files.

    There are just not enough hours in the day anymore!

    Thank you again!

    P.S... I love WordPress. I need to get off my arse and get some hosting I guess!

  10. whooami
    Member
    Posted 6 years ago #

    If I understand your question correctly, you are asking if you need to run php in CGI mode to do this? If thats the case, nope you dont.

    In fact, if you are considering that, I would can that idea, or recompile your Apache, if you have already done it. I tend to be a purist though :P

  11. ClaytonJames
    Member
    Posted 6 years ago #

    I've yet to do anything with it. I may slap another box together and experiment though. I don't think I have a need for it right now, but at some point I will want to know how to do it correctly. I have a ton of reading up to do. I'm so uptight about security issues in general, I'd rather take my time and learn the right way to do it.

    I agree with you on the purist thinking. I like as little as possible with the greatest functionality from the highest trusted source. Chrome and pearl paint never makes it go any faster, and I like to know that whatever is there is because thats where I put it. All I need now is for my education to catch up with my imagination. :-)

    Thanks again!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags