Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-06-2007, 11:05 AM   #1
Registered: Dec 2006
Posts: 59

Rep: Reputation: 15
error from .php file call in cron

Hello, im have the following in a php script, which cron runs every now and then!

$c1 = "useradd ".$username." -p $(crypt ".$clearpass.")";
Everything else in the script works fine, except this which returns this error to me by mail:

X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>

sh: useradd: command not found
Can anyone tell me where i have gone wrong? if i run useradd laura -p $(crypt laurahelm) in the comand prompt it works fine.


(im running it on CentOS 4.4)
Old 01-07-2007, 03:52 AM   #2
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I know 2/5's of not very much about php.

That said, my useradd binary in CentOS 4.4 is in /usr/sbin, so if yours is in the same place, which I guess it is, you may need to fix the PATH



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script using /etc/cron.hourly to execute cron.php file? rioguia Programming 3 06-11-2008 09:09 AM
php error: Call to undefined function: mysql_pconnect() The00Dustin Linux - Software 3 02-21-2006 10:05 PM
PHP error: Call to undefined function xml_parser_create mfrappier001 Linux - Software 0 01-29-2006 06:06 PM
call a php file petenyce Linux - Newbie 3 11-23-2005 04:21 AM
Calling a Php file from CRON every hours ? airbuzz *BSD 10 02-03-2004 03:04 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:03 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration