| Author |
Message |
kenoodo Lifeless Person
Joined: 17 Jul 2005 Posts: 1092 Location: MengDai
|
Posted: Wed Jan 09, 2008 9:56 am Post subject: Where is php.ini? |
|
|
I got | Quote: | | Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 535 bytes) in /usr/home/kenoodo/public_html/daibbs/admin/global.php on line 272 | error.
After searching, I get that it to reset the ”memory_limit” in php.ini would solve the problem, but I can find it in nowhere.
Any idea? Thanks  |
|
| Back to top |
|
| |
Jacky intel inside

Joined: 01 Jan 2005 Posts: 3794
|
Posted: Wed Jan 09, 2008 11:04 am Post subject: |
|
|
php.ini is a PHP settings file.
You can have your own php.ini file. Just place the setting that you want in Notepad (in this case the setting for memory), save it as an ini file, then upload to the directory that you need it in.
And if I'm not wrong you can set the allowed memory in .htaccess.
More information at the Knowledge Base. _________________ 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342
11706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294
89549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133
9360726024 |
|
| Back to top |
|
| |
kenoodo Lifeless Person
Joined: 17 Jul 2005 Posts: 1092 Location: MengDai
|
Posted: Fri Jan 11, 2008 7:34 am Post subject: |
|
|
Thanks. I solved that problem by other way.
Still have no idea how to do with php.ini or .htaccess, thank you very much anyway. |
|
| Back to top |
|
| |
exsanguination Forum Regular
Joined: 27 Apr 2005 Posts: 418 Location: Australia
|
Posted: Fri Jan 11, 2008 3:56 pm Post subject: |
|
|
Rather than just upping the memory limit blindly when you run out of memory, you should investigate Why it happened? Is it repeatable? Is it a load problem, or application code? Are you sure they code is solving the problem correctly? I've seen so many stupid things done by other people at work that it no longer surprises me to do silly things like filtering and sorting outside of the database. They just return everything and do the processing in the application code and wonder why it blows up when they hit a ceiling in the size of the result set.
PHP.ini is usually stored in the PHP install directory hierarchy. Mine is in /usr/local/php5/lib/php.ini.
Just use something like locate to find it
| Code: | | [andrew@eudora:~]$ locate php.ini |  |
|
| Back to top |
|
| |
krt ...

Joined: 11 Jan 2005 Posts: 4704 Location: Down Under
|
Posted: Sun Jan 13, 2008 2:00 am Post subject: |
|
|
exsanguination, I doubt he has shell access. What is referred to by Jacky is a local php.ini that overrides the global php.ini.
kenoodo, first you would create the php.ini file in your web root, i.e. public_html/ and then add the following line in the file, e.g. for an 32MB memory limit:
But, as exsanguination said, it is most likely caused by an issue in the script, meaning it should not need to use that much memory.
What script are you using? |
|
| Back to top |
|
| |
|
|
|