How to PHP5-Apache2 Server API change to GastCGI

scars230

Geek Trainee
Hey,
My Current settings is Server API Apache 2.0 Handler.

Theres this php file that i want to run in cron at interval of 10 minutes.
php -q /var/www/extra/cron/cron.php

My crontab has the following entry :-
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --repo$
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --repo$
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --repo$
*/5 * * * * root /usr/local/sbin/resched.sh > /dev/null 2>&1
*/10 * * * * root /usr/bin/php -q /var/www/extra/cron/cron.php
#

But the last cron line is not working due to (waht i feel) server api being set to apache 2.0 handler.

Please advice
 
Have you tried executing it with curl instead of the php shell? Perhaps run it as the user who owns apache instead of root, or does it need root privileges for some reason?
 
Hi,
Ummm. . . the file is encrypted with IonCube Loader (Which is running perfectly) so i cannt see whats inside he file.
I dont know how to run it with curl.
I believe it has to be run as root. (no such info about which user should run it in the documentaion).
I quote the Cron page of the software www.swiftpanel.com
To enable server monitoring, set up the cron job to run every 10 minutes.
Create the following Cron Job using PHP:
php -q /var/www/extra/cron/cron.php

You could also see the softwares demo . . . its there at their site.
 
PHP .inc file issues
To keep the configuration parameters many of us create include files and keep it inside the document root. Major concern regarding include files is the exposure of the source code through the user's browser.
Includes files uses a .inc file extension. Apache has no idea about the include files.The DefaultType of Apache is text/plain. So in this scenario anybody can access the include file via URL and see the source code in the browser.
Fixes:
This can be easily avoided by reorganizing the application. Include files can be moved outside of the document root. The best practice is to consider that all the files and folders present inside the document root are public.By storing as much information out side the document root, you limit this exposure.
There are other ways too but do not rely on them. These include following:
- Instructing Apache to process .inc files as PHP
AddType application/x-httpd-php .inc
- Using a .php file extension for includes
- Instructing Apache to deny requests for .inc resources
<Files ~ "\.inc$">
Order allow,deny
Deny from all
</Files>

thanks,
Eliza
 
Ummm . . . I do understand a lot of what you just typed.
But as far as i understand it there is no .inc file in the same folder as cron or the folder above it.
 
Back
Top