Another option, which I find easier, is to run the script with cron and tell bash to login (hence using /etc/profile.d/.../etc/profile.d/... environment definitions)
In crontab -ecrontab -e file:
*/1 * * * * bash -l -c './cron_job.sh' */1 * * * * bash -l -c 'php -f ./cron_job.php' Any command after the source of .bash_profile.bash_profile will have your environment as if you logged in.