ok... here is something after a few different builds i got the cli to work like this:
#php myscript.php with php being /usr/local/bin/php but if i use the hash and the bang(!) in the script itself like #!/usr/local/bin/php i get the aforementioned error.... probably this is a VERY stupid question but... WHY? it works on the bsd machine.... thanks a lot.... On Sat, 13 Sep 2003, Kalin Mintchev wrote: > > > > are you on RH8? > > > On Sat, 13 Sep 2003, R P Herrold wrote: > > > On Sat, 13 Sep 2003, Kalin Mintchev wrote: > > > > > On Sat, 13 Sep 2003, Reuben D. Budiardja wrote: > > > > > > > On Saturday 13 September 2003 01:57 am, Kalin Mintchev wrote: > > > > > > > #!/usr/local/bin/php > > > > > <? > > > > > $db = mysql_connect(localhost, "user", "pass"); > > > > > mysql_select_db("mymaindb",$db); > > > > > $result = mysql_query("SELECT * FROM theTable",$db); > > > > > printf("l1: %s\n", mysql_result($result,0,"some_column")); > > > > > ?> > > > > > > > > Are both machine has the same php.ini? Try using > > > > <?php > > > > I have used (and am using) the stock php package from Red hat > > with no problems doing CLI PHP -- see my presentation notes > > at: > > http://www.colug.net/notes/0208mtg/ > > > > You may need to point at the path to the /etc/php.ini file > > [the " -c/etc " part], and ensure that you are pointing to the > > correct binary. Check the '#!' line in the following > > example. > > > > As to interacting with a MySQL database, again I use a stock > > Red Hat install without the need for a recompile without > > problems. Here is a sample script, which cleans out some "'" > > characters, and marks improper (US) phone numbers as 'dnc' -- > > do not call -- in an outbound dialling application database: > > > > > > bash-2.05b$ cat preenTelNum.php > > #!/usr/bin/php -c/etc > > <?php > > // > > // Clean the dialling database > > // > > // Copyright (c) 2002 Owl River Company > > // [EMAIL PROTECTED] > > // > > // Get the database keying > > // > > $db_server = "10.20.30.40"; > > $db_user = "telephone"; > > $db_passwd = "secret"; > > $db_name = "listing"; > > // > > $link = mysql_connect($db_server, $db_user, $db_passwd) > > or die("Could not connect to $db_server as $db_user \n"); > > // > > $isdb = mysql_select_db($db_name) > > or die("Could not get database $db_name \n"); > > // > > $select1 = "select * from phones where dnc is null "; > > $result1 = mysql_query($select1); > > // > > $rows = 0 ; > > while ($row1 = mysql_fetch_assoc($result1)) { > > // > > $rows += 1 ; > > // > > $d_first = $row1["first"]; > > $d_first = eregi_replace('\'','',$d_first); > > $d_last = $row1["last"]; > > $d_last = eregi_replace('\'','',$d_last); > > $d_telno = $row1["telno"]; > > $d_uid = $row1["uid"]; > > // > > $testdigit = substr($d_telno,3,1); > > // > > if ("$testdigit" == "1" || "$testdigit" == "0") { > > print "$d_first $d_last $d_telno $d_uid \n"; > > // > > $select2 = "update phones set dnc = 'x' where uid = '$d_uid' "; > > $result2 = mysql_query($select2); > > // > > } > > // > > print "$rows changed \n"; > > // > > } > > // > > ?> > > > > > > > > > -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED] https://www.redhat.com/mailman/listinfo/redhat-list