Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
unable to get a cgi script to run
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- unable to get a cgi script to run
unable to get a cgi script to run
06-05-2010 8:55 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Hi
Its been a while since i used by cgi space and we no longer have SSH access to the command line. Reading other post i should be able to write and run a script
I am trying to unzip a tar file but always get an error message
The server encountered an internal error and was unable to complete your request.
Error message:
Premature end of script headers: test99.cgi
followed a server 500 message
The script is
#!/bin/bash
echo "Content-type: text/plain"
echo
tar -xvvzf joomla.tar.gz
the script is in the same folder as the file. Can anyone help me here as i unable to sort this one out
Thanks
Nick
Its been a while since i used by cgi space and we no longer have SSH access to the command line. Reading other post i should be able to write and run a script
I am trying to unzip a tar file but always get an error message
The server encountered an internal error and was unable to complete your request.
Error message:
Premature end of script headers: test99.cgi
followed a server 500 message
The script is
#!/bin/bash
echo "Content-type: text/plain"
echo
tar -xvvzf joomla.tar.gz
the script is in the same folder as the file. Can anyone help me here as i unable to sort this one out
Thanks
Nick
Message 1 of 6
(1,387 Views)
5 REPLIES 5
Re: unable to get a cgi script to run
06-05-2010 11:23 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Have you set permissions (chmod) on test99.cgi to 0700?
David
Message 2 of 6
(524 Views)
Re: unable to get a cgi script to run
07-05-2010 8:40 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Quote from: spraxyt Have you set permissions (chmod) on test99.cgi to 0700?
I believe so
-rwx------ 1 xxxxxxcgiusers 76 May 6 20:35 test99.cgi
Regards
Nick
Message 3 of 6
(524 Views)
Re: unable to get a cgi script to run
07-05-2010 12:06 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
OK
seems i finally resolved the issue. I uploaded a ZIP version as opposed to TAR and used the following script
<?php
exec('unzip Joomla_1.5.17-Stable-Full_Package.zip',$ret);
?>
I ran this script to see what is available
<?php
foreach ( array('tar','gtar','unzip','gunzip') as $bin) {
exec ("whereis $bin", $ret);
print join(', ', $ret).'<br>';
}
?>
results as follows
tar: /bin/tar /usr/share/man/man1/tar.1.gz
tar: /bin/tar /usr/share/man/man1/tar.1.gz, gtar:
tar: /bin/tar /usr/share/man/man1/tar.1.gz, gtar:, unzip: /usr/bin/unzip /usr/share/man/man1/unzip.1.gz
tar: /bin/tar /usr/share/man/man1/tar.1.gz, gtar:, unzip: /usr/bin/unzip /usr/share/man/man1/unzip.1.gz, gunzip: /bin/gunzip /usr/share/man/man1/gunzip.1.gz
I deduced from this that tar and gtar are unavailable and we have ZIP or GUNZIP
Am I correct in my theory?
Anyway issue resolved
Nick
seems i finally resolved the issue. I uploaded a ZIP version as opposed to TAR and used the following script
<?php
exec('unzip Joomla_1.5.17-Stable-Full_Package.zip',$ret);
?>
I ran this script to see what is available
<?php
foreach ( array('tar','gtar','unzip','gunzip') as $bin) {
exec ("whereis $bin", $ret);
print join(', ', $ret).'<br>';
}
?>
results as follows
tar: /bin/tar /usr/share/man/man1/tar.1.gz
tar: /bin/tar /usr/share/man/man1/tar.1.gz, gtar:
tar: /bin/tar /usr/share/man/man1/tar.1.gz, gtar:, unzip: /usr/bin/unzip /usr/share/man/man1/unzip.1.gz
tar: /bin/tar /usr/share/man/man1/tar.1.gz, gtar:, unzip: /usr/bin/unzip /usr/share/man/man1/unzip.1.gz, gunzip: /bin/gunzip /usr/share/man/man1/gunzip.1.gz
I deduced from this that tar and gtar are unavailable and we have ZIP or GUNZIP
Am I correct in my theory?
Anyway issue resolved
Nick
Message 4 of 6
(524 Views)
Re: unable to get a cgi script to run
07-05-2010 1:07 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
tar, unzip and gunzip are available, paths are given for them in your script output.
tar on ccgi is gtar, it's just not called gtar. You'd not normally find gtar called gtar on linux systems, however it's common on Solaris and BSD based systems.
tar on ccgi is gtar, it's just not called gtar. You'd not normally find gtar called gtar on linux systems, however it's common on Solaris and BSD based systems.
Message 5 of 6
(524 Views)
Re: unable to get a cgi script to run
07-05-2010 2:16 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Using a test directory I created a tar file using 'tar -cvvzf filename.gz dirname', listed it using 'tar -tvvzf filename.gz' and extracted it using 'tar -xvvzf filename.gz' without problems. So I wonder if the original joomla file might have been damaged?
I had wondered if the very-verbose option was causing problems, but it proved not to be. However a single 'v' is sufficient.
I had wondered if the very-verbose option was causing problems, but it proved not to be. However a single 'v' is sufficient.
David
Message 6 of 6
(524 Views)
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- unable to get a cgi script to run