Subject Re: [firebird-support] fail to exec an SQL script thru PHP
Author unordained
The exec() functions can be nasty -- have you tried backticks (just for kicks)?

$result = `/root/test/start.sh`;

-Philip

---------- Original Message -----------
From: "Peppe Polpo" <octopushole@...>
To: firebird-support@yahoogroups.com
Sent: Tue, 03 Feb 2004 00:36:41 -0000
Subject: [firebird-support] fail to exec an SQL script thru PHP

> I am wetting my feet in PHP, so this is almost surely a PHP issue.
> Only I thought that it could be of interest to many FB users.
>
> I have a Linux server with RH9 and FB 1.0 .
>
> I wrote 2 PHP forms.
>
> In the first one, the user inputs some data.
>
> Data is passed to the second form, where it is massaged and used to
> build a SQL script, then the script is executed.
>
> The script is called script.sql and its current containt is
>
> set term !! ;
> select * from autoshift(1,'2004-3-1','2004-3-31',1) !!
> commit !!
> set term ; !!
>
> The script should be launched by a second shell script. The script is
> called start.sh and its containt is
>
> /opt/interbase/bin/isql e -u "SYSDBA" -p "masterkey" -
> i "/root/test/script.sql" /root/test/auto.gdb
>
> When I run the script from my SSH client as
>
> /root/test/start.sh
>
> it runs ok.
>
> However, when I launch the script from a browser, the normal program
> flow stops at the line
>
> exec("/root/test/start.sh")
>
> I mean that the code that follows that line is never executed.
>
> I am aware of the permissions issue, but even if I gave 777 mode to
> all directories and files involved, I could not fix the problem.
>
> It must be a very stupid mistake I am doing.
>
> Any hint ?
>
> Regards
>
> Peppe Polpo
>
>
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/firebird-support/
>
> To unsubscribe from this group, send an email to:
> firebird-support-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to:
> http://docs.yahoo.com/info/terms/
------- End of Original Message -------