I've got a file index.php. there are 2 users having separate crons running accesing the scripts. is there any function in php/linux to identify which user's cron called that... its a cent-os..
nope.... the answer is apache in all cases.... since the php code is executed as apache user
Akhil K Nambiar
2010-09-13 11:17:23
Please show what your cron entries look like. If you use `php -f`, this should not be the case.
Pekka
2010-09-13 11:23:50
no i use CURL function... in the cron. my cron script is like */10 * * * * cron "example.com/index.php"
Akhil K Nambiar
2010-09-14 07:33:12
nope.... the answer is apache in all cases.... since the php code is executed as apache user...
Akhil K Nambiar
2010-09-13 11:16:58
+1
A:
Two options:
- Let the cronscript call the script directly, e.g.
php -f script.php
- Let the cronscript specifify use user as a parameter, e.g.
wget http://host/script.php?user=$USER
Sjoerd
2010-09-13 11:20:49
A:
You have to pass user info from your client (cronjob in this case). On server end php process is always run by webserver (apache in your case). So setup the cron to pass user something like: example.com/index.php?user=$USER and get this on server end as $_GET['user']
Vikas
2010-09-14 14:06:10