Reputation: 1820
I am getting this strange error on PHP 5.3.1 on Apache 2.2.14. I went thru the forums and most suspect it is a PHP-issue memory-leak issue. WHile I upgrade PHP, I wanted to know if there is a way for the server to recover - to be restarted programatically. Currently, I have to manually start-stop Apaache
Warning: Attempt to assign property of non-object in D:\xampp_ext\xampp\htdocs\soki\test.soki.com\symfony\lib\autoload\sfCoreAutoload.class.php on line 38
Warning: require(/config/sfProjectConfiguration.class.php) [function.require]: failed to open stream: No such file or directory in D:\xampp_ext\xampp\htdocs\soki\test.soki.com\symfony\lib\autoload\sfCoreAutoload.class.php on line 99
Fatal error: require() [function.require]: Failed opening required '/config/sfProjectConfiguration.class.php' (include_path='.;d:\xampp_ext\xampp\php\PEAR') in D:\xampp_ext\xampp\htdocs\soki\test.soki.com\symfony\lib\autoload\sfCoreAutoload.class.php on line 99
I'm using PHP 5.3.1 on Apache 2.2.14
Upvotes: 0
Views: 516
Reputation: 1820
I read jillions of blog posts about the error, and my best option was to upgrade to PHP 5.3 and that resolved the problem. It was definitely due to a memory leak somewhere that was preventing additional files to be loaded
Upvotes: 0
Reputation: 1497
Assuming that you are using mod_php requires to work with the Apache prefork worker model. There is a configuration setting you can use to implement a work-around:
With the MaxRequestsPerChild directive you can set a number of requests that will be processed before child processes will be recycled. Workaround: Put it to a low value, so that Apache will recycle it's children more often.
<IfModule prefork.c>
StartServers 2
MinSpareServers 3
MaxSpareServers 3
ServerLimit 30
MaxClients 30
MaxRequestsPerChild 200
</IfModule>
Please keep in mind that this is only a dirty hack and not a serious solution of your problem.
Upvotes: 1
Reputation: 87
PHP is run by Apache, so if Apache has indeed crashed, you can't easily use PHP to start Apache again unless PHP is being called by some other program besides Apache (example: running PHP as a cron job/scheduled task by calling PHP.exe [script.php] directly).
I'm assuming by the path in your error message that you're using a Windows environment (obviously). You don't want a script or program in the background starting Apache over and over if the process isn't running; that's messy. You could but that is nowhere near ideal.
How do you even know Apache is crashing? The errors you provided are errors from PHP, not Apache. If you refresh the page and still see errors (or anything besides a Connection Failure/Forcefully rejected/etc.) then Apache is still running.
Upvotes: 1