LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-12-2014, 10:31 PM   #1
Chiba
LQ Newbie
 
Registered: Oct 2014
Posts: 3

Rep: Reputation: Disabled
How to auto prepend a cgi script ?


Hi;

I use auto prepend in .htaccess for php files and work well, for example :
Code:
php_value auto_prepend_file "/var/www/html/file.php"
But how to do that for cgi script which is an executable ? For example :
Code:
php_value auto_prepend_file "/var/www/html/script.cgi"
This command return the content of the script.cgi file instead of executing it. So what is the issue or what i am missing to add in my .htaccess file to make the script execute ?

Thank you
 
Old 10-13-2014, 12:47 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,464

Rep: Reputation: 450Reputation: 450Reputation: 450Reputation: 450Reputation: 450
Hi

As far as I know, it is not possible. Also it doesn't make much sense. A cgi typically uses some parameters and outputs a HTML page. You want it to be executed before a PHP script? If all you need to do is execute it, you can do it inside the PHP file that you auto_prepend.

PHP Code:
$output shell_exec("/var/www/html/script.cgi");
// what to do with $output? 
 
  


Reply


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
calling CGI script in CGI script ravi_chobey Programming 3 03-19-2009 01:36 PM
bash 'prepend' script linmix Programming 31 12-02-2005 04:53 PM
Perl/CGI Creating Auto Logouts (like bank sites) anthonysaulnier Programming 3 10-17-2005 01:36 PM
auto-completion - how does it work & can my script args auto-complete? BrianK Programming 1 06-11-2004 05:51 PM
Auto Run A Cgi Script f117bomb Linux - General 1 11-25-2001 02:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:45 PM.

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