开发者

weird CGI error

开发者 https://www.devze.com 2023-01-03 02:45 出处:网络
I have a cgi script working on my localhost (ubuntu 10.04) just by dropping them to /usr/lib/cgi-bin but... in production (ubuntu 10.04) they never run:

I have a cgi script working on my localhost (ubuntu 10.04) just by dropping them to /usr/lib/cgi-bin

but... in production (ubuntu 10.04) they never run:

Apache error.log:

[Sun Jun 13 13:13:58 2010] [error] (2)No such file or directory: exec of '/var/www/cgi-bin/tbk_bp_resultado.cgi' failed
[Sun Jun 13 13:13:58 2010] [error] [client 190.161.196.57] Premature end of script headers: tbk_bp_resultado.cgi

I check the permissions and seems not to be the problem:

drwsrwsrwx 2 root root    4096 Jun 12 19:54 datos
-rwxrwxrwx 1 root root 开发者_开发问答     76 Jun 13 02:13 erf.cgi
drwsrwsrwx 2 root root    4096 Oct  2  2008 log
drwsrwsrwx 2 root root    4096 Jun 12 19:54 maestros
-rwxrwxrwx 1 root root 1282027 Sep 16  2008 tbk_bp_pago.cgi
-rwxrwxrwx 1 root root 1280404 Sep 16  2008 tbk_bp_resultado.cgi
-rwxrwxrwx 1 root root 1275985 Sep 16  2008 tbk_check_mac.cgi
drwsrwsrwx 2 root root    4096 Jun 12 19:54 template

In my localhost I doesn't have to do anything in order to work, but in production I have to add this in my apache conf:

ScriptAlias /cgi-bin/ /var/www/cgi-bin/

<Directory /var/www/cgi-bin>
        Options +ExecCGI
</Directory>

AddHandler cgi-script .cgi .pl

=( thanks.


Try installing ia32-libs. I had the same problem because my ubuntu is a 64bit version and the kcc is compiled for 32bit use.


Ummm I had the same problem, I fixed uploading the *.cgi in binary mode with


First of all i'd like to address the reason why cgi works locally and not on the server, as you state:

I have a cgi script working on my localhost (ubuntu 10.04) just by dropping them to /usr/lib/cgi-bin

There is one major thing you are not seeing here; Apache default configuration. If you go to /etc/apache2/sites-enabled/000-default and check it's content, you will see the following:

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
</Directory>

which is the same you are including on the server to use another path /var/www/cgi-bin/

If you take your cgi's and put them inside /usr/lib/cgi-bin/ on the server they will work out of the box, as expected.

Now ... as for the error, both responses given so far by user689374 and JosephCastro are correct. Transbank cgi scripts are 32 bit aplications, so, in orther to run on 64bit environments, they need to have ia32-libs, AND, they break if not uploaded in binary mode, as they have some weird characters that get deleted or changed if uploaded any other way. You can use Filezilla and change transfer mode to binary.

Hope this helps you and anyone else strugling with transbank ... it's really a pain ...

EDIT:

Just realiced it's a 2 year old question ... well ... still. There is so little info on this particular subject around that i'll leave it here anyway :D

0

精彩评论

暂无评论...
验证码 换一张
取 消