You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jean-Christophe Montigny <jc...@assoces.com> on 2005/06/09 14:52:00 UTC

Re: [users@httpd] php scripts run except in cgi-bin

(be aware, that is an obvious question)

Do you have the line
#/usr/bin/php
(or whatever your path to php is) at its beginning?

As well, you cannot send raw data just like a normal php script.
Just like any CGI you need to send the string
Content-type: text/html

there's another line but I cannot remember... just google about 
structure for perl cgi script, it's the same lines.

gradeAstudent.com.au wrote:
> Anyone have any pointers on getting php scripts to run from the cgi-bin
> directory? I can run php scripts fine so long as they are not in the default
> cgi-bin folder. Alas, however, a survey program I am trying to test (not
> written by me) needs to have its scripts in the cgi-bin folder for some
> reason.
> 
> I have tried the permissions (even set to 777!) and changed the uid gid to
> www:www. Perl scripts run fine from this cgi-bin folder which is really
> bugging me.
> 
> I have set ExecCGI in the Options on the cgi-bin folder as well as allow all
> and all that jass in the <Directory> statements.
> 
> It just seems like apache has some security feature that prevents php from
> running in this one folder (even when i move it and reconfigure httpd.conf
> to point to a different folder under the data dir).
> 
> Squirellmail which makes extensive use of php is running fine, so I'm fairly
> 'confident' that php is setup ok?
> 
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


-- 
Jean-Christophe Montigny
Responsable Commission Web, Association Planètes
Responsable serveurs assoces.com, Association Planètes
Etudiant de deuxième année à Grenoble Ecole de Management
Majeure Conseil en Organisation des Systèmes d'Information

Re: [users@httpd] php scripts run except in cgi-bin

Posted by "Ivan Barrera A." <Br...@Ivn.cl>.
>>>
>>>>Anyone have any pointers on getting php scripts to run from the cgi-bin
>>>>directory? I can run php scripts fine so long as they are not in the
>>>>default
>>>>cgi-bin folder.
> 
> 
> Hmmm... I'm guessing this person wants to run the php module, not php
> as a CGI.  Hence the problem is that apache assumes everything in a
> ScriptAlias'ed directory is a CGI.  To fix this, replace the
> ScriptAlias /cgi-bin/ /whatever/
> with
> Alias /cgi-bin/ /whatever/
> 
> But be careful, since this will also disable any real CGI scripts.
> 
> Joshua.


Uh.. sorry..
didn't read the whole thread.. just corrected the cgi interpreter line

> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] php scripts run except in cgi-bin

Posted by Joshua Slive <js...@gmail.com>.
On 6/9/05, Ivan Barrera A. <Br...@ivn.cl> wrote:
> Jean-Christophe Montigny wrote:
> > (be aware, that is an obvious question)
> >
> > Do you have the line
> > #/usr/bin/php
> 
> #!/path/to/exe
> 
> 
> 
> > (or whatever your path to php is) at its beginning?
> >
> > As well, you cannot send raw data just like a normal php script.
> > Just like any CGI you need to send the string
> > Content-type: text/html
> >
> > there's another line but I cannot remember... just google about
> > structure for perl cgi script, it's the same lines.
> >
> > gradeAstudent.com.au wrote:
> >
> >> Anyone have any pointers on getting php scripts to run from the cgi-bin
> >> directory? I can run php scripts fine so long as they are not in the
> >> default
> >> cgi-bin folder.

Hmmm... I'm guessing this person wants to run the php module, not php
as a CGI.  Hence the problem is that apache assumes everything in a
ScriptAlias'ed directory is a CGI.  To fix this, replace the
ScriptAlias /cgi-bin/ /whatever/
with
Alias /cgi-bin/ /whatever/

But be careful, since this will also disable any real CGI scripts.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] php scripts run except in cgi-bin

Posted by "Ivan Barrera A." <Br...@Ivn.cl>.
Jean-Christophe Montigny wrote:
> (be aware, that is an obvious question)
> 
> Do you have the line
> #/usr/bin/php

#!/path/to/exe



> (or whatever your path to php is) at its beginning?
> 
> As well, you cannot send raw data just like a normal php script.
> Just like any CGI you need to send the string
> Content-type: text/html
> 
> there's another line but I cannot remember... just google about
> structure for perl cgi script, it's the same lines.
> 
> gradeAstudent.com.au wrote:
> 
>> Anyone have any pointers on getting php scripts to run from the cgi-bin
>> directory? I can run php scripts fine so long as they are not in the
>> default
>> cgi-bin folder. Alas, however, a survey program I am trying to test (not
>> written by me) needs to have its scripts in the cgi-bin folder for some
>> reason.
>>
>> I have tried the permissions (even set to 777!) and changed the uid
>> gid to
>> www:www. Perl scripts run fine from this cgi-bin folder which is really
>> bugging me.
>>
>> I have set ExecCGI in the Options on the cgi-bin folder as well as
>> allow all
>> and all that jass in the <Directory> statements.
>>
>> It just seems like apache has some security feature that prevents php
>> from
>> running in this one folder (even when i move it and reconfigure
>> httpd.conf
>> to point to a different folder under the data dir).
>>
>> Squirellmail which makes extensive use of php is running fine, so I'm
>> fairly
>> 'confident' that php is setup ok?
>>
>>
>>
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP Server
>> Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org