# Best PHP.ini

**URL:** <https://www.ruby-forum.com/t/best-php-ini/168323>\
**Category:** NGINX\
**Created:** [May 19, 2009, 5:00pm UTC](https://www.ruby-forum.com/t/best-php-ini/168323 "2009-05-19T17:00:32Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wicked](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f04885/32.png) [@Wicked](https://www.ruby-forum.com/u/Wicked)\
**Post date:** [May 19, 2009, 5:00pm UTC](https://www.ruby-forum.com/t/best-php-ini/168323/1 "2009-05-19T17:00:32Z")

</div>

Hello,

i’m searchin for a good php.ini…

my Server Specs…

CPU: AMD Athlon™ 64 X2 Dual Core Processor 4200+  
Memory: 2GB Ram  
HDD: 2 x 300gb  
Linux Distr.: Debian Lenny  
Nginx Version: Nginx 0.6.36 with spawn-cgi(lighttpd)  
PHP version: PHP 5.2.6-1+lenny3 with Suhosin-Patch 0.9.6.2 (cli) (built:  
Apr 26 2009 22:16:23) With Xcache  
MySQL version: mysql Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu  
(i486)

its for a Vbulletin Board…

i moment i use the default php.ini… any one can help me??

Posted at Nginx Forum:

> **[Best PHP.ini](https://forum.nginx.org/read.php?2,2188,2188#msg-2188)**
>
> Hello, i'm searchin for a good php.ini.. my Server Specs.. CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ Memory: 2GB Ram HDD: 2 x 300gb Linux Distr.: Debian Lenny Nginx Version: Nginx 0.6.36 with spawn-cgi(lighttpd)

---

<div class="post-metadata">

**Author:** ![Wicked](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f04885/32.png) [@Wicked](https://www.ruby-forum.com/u/Wicked)\
**Post date:** [May 19, 2009, 9:21pm UTC](https://www.ruby-forum.com/t/best-php-ini/168323/2 "2009-05-19T21:21:04Z")

</div>

I think you will gain more if you use the latest version of PHP and  
latest version of MySQL 5.1 to get the best performance out of your  
default settings.

[http://www.dotdeb.org](http://www.dotdeb.org)

And bother to optimize when you have a performance problem.

---

<div class="post-metadata">

**Author:** ![Wicked](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f04885/32.png) [@Wicked](https://www.ruby-forum.com/u/Wicked)\
**Post date:** [May 19, 2009, 10:13pm UTC](https://www.ruby-forum.com/t/best-php-ini/168323/3 "2009-05-19T22:13:21Z")

</div>

Hello

I have this question postet on [vbulletin.com](http://vbulletin.com) but i have only a anwser  
for mysql and not for php or php5-cgi

top says this

Cpu(s): 63.2%us, 14.8%sy, 0.2%ni, 21.6%id, 0.0%wa, 0.0%hi, 0.2%si,  
0.0%st

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND  
2261 mysql 15 -5 218m 94m 5364 S 61 4.7 119:27.98 mysqld  
7529 www-data 20 0 169m 24m 11m R 25 1.2 0:17.98 php5-cgi  
7533 www-data 20 0 164m 15m 7808 S 25 0.8 0:14.86 php5-cgi  
7528 www-data 20 0 166m 20m 10m S 23 1.0 0:18.72 php5-cgi  
7525 www-data 20 0 166m 20m 10m S 22 1.0 0:21.54 php5-cgi

and i think this is high server load for 50 user logged into vbulletin  
board…

i will upgrade my mysql and php…

Posted at Nginx Forum:

> **[Re: Best PHP.ini](https://forum.nginx.org/read.php?2,2188,2205#msg-2205)**
>
> Hello, i'm searchin for a good php.ini.. my Server Specs.. CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ Memory: 2GB Ram HDD: 2 x 300gb Linux Distr.: Debian Lenny Nginx Version: Nginx 0.6.36 with spawn-cgi(lighttpd)

---

<div class="post-metadata">

**Author:** ![Wicked](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f04885/32.png) [@Wicked](https://www.ruby-forum.com/u/Wicked)\
**Post date:** [May 19, 2009, 10:29pm UTC](https://www.ruby-forum.com/t/best-php-ini/168323/4 "2009-05-19T22:29:18Z")

</div>

Good Lord man, am I seeing those numbers correctly?

For one thing, vBulletin is resource-hungry. I personally would go with  
phpBB3. I’ve had a few hundred people logged into phpBB3 and my memory  
usage hasn’t gone above 400MB, with Apache \<— yes apache, and MySQL  
together.

On Tue, May 19, 2009 at 10:06 PM, Wicked [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND  
> i will upgrade my mysql and php..
> 
> Posted at Nginx Forum:  
> [http://forum.nginx.org/read.php?2,2188,2205#msg-2205](http://forum.nginx.org/read.php?2,2188,2205#msg-2205)

–

Casey  
Stengel[http://www.brainyquote.com/quotes/authors/c/casey\_stengel.html](http://www.brainyquote.com/quotes/authors/c/casey_stengel.html)

- “There comes a time in every man’s life, and I’ve had plenty of  
them.”

---

<div class="post-metadata">

**Author:** ![Wicked](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f04885/32.png) [@Wicked](https://www.ruby-forum.com/u/Wicked)\
**Post date:** [May 19, 2009, 11:13pm UTC](https://www.ruby-forum.com/t/best-php-ini/168323/5 "2009-05-19T23:13:50Z")

</div>

Also, take a look at optimizing you MySQL config, there is not much  
you can do about the php.  
Upgrade your PHP and MySQL as per my previous email. let MySQL run for  
at least 48 hours and run this on the server

[http://www.day32.com/MySQL/tuning-primer.sh](http://www.day32.com/MySQL/tuning-primer.sh)

It will give you advice on what to optimize in MySQL, you have 2GB of  
memory and MySQL is not using much of it, that seems like a problem.

---

<div class="post-metadata">

**Author:** ![Wicked](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f04885/32.png) [@Wicked](https://www.ruby-forum.com/u/Wicked)\
**Post date:** [May 20, 2009, 4:44am UTC](https://www.ruby-forum.com/t/best-php-ini/168323/6 "2009-05-20T04:44:34Z")

</div>

On Wed, May 20, 2009 at 4:06 AM, Wicked [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> i will upgrade my mysql and php..

To do so will drop security serveries from debian, then you must take  
care  
all the security patches by yourself then. The latest versions tend to  
come  
with new bugs also and can’t always give best performance most of time.

Just compile php-fpm together with patches and source from debian/lenny  
with  
php-5.26, then recompile it when debian updates php for security, thus  
you  
needn’t to worry about security things.

---

<div class="post-metadata">

**Author:** ![Wicked](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f04885/32.png) [@Wicked](https://www.ruby-forum.com/u/Wicked)\
**Post date:** [May 20, 2009, 10:02am UTC](https://www.ruby-forum.com/t/best-php-ini/168323/7 "2009-05-20T10:02:58Z")

</div>

What you are talking about is not as valid for PHP and MySQL for  
example where these distributes tend to be always one major version  
behind. Zend Server ships with the latest PHP 5.2.9 and their pretty  
much sell it to their enterprize customers. MySQL 5.1 has seen good  
improvements and is currently well into stable state.

I would not use bleeding edge version of OS software but the web  
development stack updates pretty often with needed updates.

---

<div class="post-metadata">

**Author:** ![Wicked](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f04885/32.png) [@Wicked](https://www.ruby-forum.com/u/Wicked)\
**Post date:** [May 20, 2009, 11:57am UTC](https://www.ruby-forum.com/t/best-php-ini/168323/8 "2009-05-20T11:57:15Z")

</div>

There is 0.0%wa, so I’m not sure this is a IO problem.

Olivier

Dave C. a écrit :

---

<div class="post-metadata">

**Author:** ![Wicked](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f04885/32.png) [@Wicked](https://www.ruby-forum.com/u/Wicked)\
**Post date:** [May 20, 2009, 11:26am UTC](https://www.ruby-forum.com/t/best-php-ini/168323/9 "2009-05-20T11:26:10Z")

</div>

Seconded, I would bet that your mysql instance is doing a lot of IO,  
mainly because your innodb buffer size is set to low. Given your  
sharing that machine with a bunch of php processes you’ll have to  
tread carefully to avoid swapping.

I would enable the slow query log (don’t forget to set the reporting  
interval to 1 second, the default is 10) and also log queries that  
don’t use indexes. Some schema tweaking may be in order.

Cheers

Dave

---

<div class="post-metadata">

**Author:** ![Wicked](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f04885/32.png) [@Wicked](https://www.ruby-forum.com/u/Wicked)\
**Post date:** [May 20, 2009, 6:01pm UTC](https://www.ruby-forum.com/t/best-php-ini/168323/10 "2009-05-20T18:01:20Z")

</div>

Hello,

i have upgrade my php with dotdeb but by mysql i have many problems with  
my tables

ERROR 1034 (HY000) at line 1: Incorrect key file for table ‘access’; try  
to repair it

etc.

and i dont cant repair this tables so i have downgraded the mysql-server  
and remove the new mysql-server and it works… but it is bad… any  
hints?

Posted at Nginx Forum:

> **[Re: Best PHP.ini](https://forum.nginx.org/read.php?2,2188,2246#msg-2246)**
>
> Hello, i'm searchin for a good php.ini.. my Server Specs.. CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ Memory: 2GB Ram HDD: 2 x 300gb Linux Distr.: Debian Lenny Nginx Version: Nginx 0.6.36 with spawn-cgi(lighttpd)

---

<div class="post-metadata">

**Author:** ![Wicked](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f04885/32.png) [@Wicked](https://www.ruby-forum.com/u/Wicked)\
**Post date:** [May 20, 2009, 12:58pm UTC](https://www.ruby-forum.com/t/best-php-ini/168323/11 "2009-05-20T12:58:50Z")

</div>

Good point, there is an outside chance you are seeing a lot of sorts  
on small tmp tables that never hit the disk, but unlikely

---

<div class="post-metadata">

**Author:** ![Wicked](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f04885/32.png) [@Wicked](https://www.ruby-forum.com/u/Wicked)\
**Post date:** [May 20, 2009, 7:12pm UTC](https://www.ruby-forum.com/t/best-php-ini/168323/12 "2009-05-20T19:12:32Z")

</div>

So did you try to repair it?

[http://dev.mysql.com/doc/refman/5.1/en/repair-table.html](http://dev.mysql.com/doc/refman/5.1/en/repair-table.html)
