Won't configure
in var/opt so that bits okay?!
http://interviolet.com/download/php_...hp_loadavg.zip
An extension to check loadaverage on execution and halt execution / redirect browser if above a certain level for the last one five or ten minutes ...
Download to your computer somewhere and open load.c
PHP_INI_ENTRY( string name, string value, PHP_INI_ALL, NULL )Code:PHP_INI_BEGIN() PHP_INI_ENTRY("loadavg.one", "0.3", PHP_INI_ALL, NULL ) PHP_INI_ENTRY("loadavg.five", "0.5", PHP_INI_ALL, NULL ) PHP_INI_ENTRY("loadavg.ten", "0.5", PHP_INI_ALL, NULL ) PHP_INI_ENTRY("loadavg.redirect", "http://google.com", PHP_INI_ALL, NULL ) PHP_INI_END()
edit the above entries to something that your server can cope with ( higher than 1.0, and keep the decimal point ), also change loadavg.redirect to some page on your server like
"PHP is smashing all the resources, blame Johnson"
then upload the files to a newly created directory anywhere on your server, and do the following ...
add loadavg.so to your extension loaders in php.iniCode:cd /path/to/newly/created/directory phpize ./configure --enable-loadavg make make install
Problem avoided, of course you could create a php.ini just for one user, so long as you're root the user can't change it and ini_set( ) from php will be ignored, the only values used are the ones in load.c .....
Last edited by Jan; November 24th, 2007 at 13:48. Reason: replaced URL by request
(\__/) Joe Watkins
(='.'=) Software Architect
(")_(") http://pthreads.org
Copy and paste bunny into your sig, help him gain world domination.
Won't configure
in var/opt so that bits okay?!
█ /\__/\ We Do Not Forgive!
█(- o *) We Do Not Forget!
█(")_(") Expect Us!
IT Help for everyone @ Scotia-IT.com - when it's finished
show me error ... I built a copy for your version of php in /home/intervio @ loadavg.so
(\__/) Joe Watkins
(='.'=) Software Architect
(")_(") http://pthreads.org
Copy and paste bunny into your sig, help him gain world domination.
./configure --enable-loadavg
-bash: ./configure: No such file or directory
█ /\__/\ We Do Not Forgive!
█(- o *) We Do Not Forget!
█(")_(") Expect Us!
IT Help for everyone @ Scotia-IT.com - when it's finished
copy and paste this code in your terminal
phpize is a command, it generates a configure script from config.m4 files, there is no configure right now ....Code:cd /var/opt/phpize && phpize && ./configure --enable-loadavg && make && make install
(\__/) Joe Watkins
(='.'=) Software Architect
(")_(") http://pthreads.org
Copy and paste bunny into your sig, help him gain world domination.
That did it
Changed to values in load.c ;
PHP_INI_BEGIN()
PHP_INI_ENTRY("loadavg.one", "1.0", PHP_INI_ALL, NULL )
PHP_INI_ENTRY("loadavg.five", "1.5", PHP_INI_ALL, NULL )
PHP_INI_ENTRY("loadavg.ten", "2.5", PHP_INI_ALL, NULL )
PHP_INI_ENTRY("loadavg.redirect", "http://www.web-spot.co.uk/alert.jpg", PHP_INI_ALL, NULL )
PHP_INI_END()
Last edited by Decker; November 15th, 2007 at 09:07.
█ /\__/\ We Do Not Forgive!
█(- o *) We Do Not Forget!
█(")_(") Expect Us!
IT Help for everyone @ Scotia-IT.com - when it's finished
yeah you still have to add it to /usr/local/lib/php.ini, where all the other extension=whatever.so lines are, just add
at the end ... thenCode:extension=loadavg.soCode:httpd restart
(\__/) Joe Watkins
(='.'=) Software Architect
(")_(") http://pthreads.org
Copy and paste bunny into your sig, help him gain world domination.
Already done - I might change the landing page thoughmaybe.
█ /\__/\ We Do Not Forgive!
█(- o *) We Do Not Forget!
█(")_(") Expect Us!
IT Help for everyone @ Scotia-IT.com - when it's finished
its not loaded .... don't see it added in php.ini ....
(\__/) Joe Watkins
(='.'=) Software Architect
(")_(") http://pthreads.org
Copy and paste bunny into your sig, help him gain world domination.
Haven't restarted httpd yet
Don't tell me you were going to test it out ??
█ /\__/\ We Do Not Forgive!
█(- o *) We Do Not Forget!
█(")_(") Expect Us!
IT Help for everyone @ Scotia-IT.com - when it's finished
I tested already, just noticing that it's not loaded dispite being installed ... so thought I would say I can't see it in php.ini ( I can't write that file but can read it ) ....
(\__/) Joe Watkins
(='.'=) Software Architect
(")_(") http://pthreads.org
Copy and paste bunny into your sig, help him gain world domination.
Try it now![]()
█ /\__/\ We Do Not Forgive!
█(- o *) We Do Not Forget!
█(")_(") Expect Us!
IT Help for everyone @ Scotia-IT.com - when it's finished
now it's loadedI feel much better ....
(\__/) Joe Watkins
(='.'=) Software Architect
(")_(") http://pthreads.org
Copy and paste bunny into your sig, help him gain world domination.
So do I for some strange reason - cough.....
Nice work Joe![]()
█ /\__/\ We Do Not Forgive!
█(- o *) We Do Not Forget!
█(")_(") Expect Us!
IT Help for everyone @ Scotia-IT.com - when it's finished
That could really come into play for people like us, running free hosts. Cheers Joe once again.
~ The Hosting Tool ~ cPanel WHM/DA Support! cP Creator Importer! Post 2 Host! Fully Automated! ~ thehostingtool.com
Bookmarks