Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old November 16th, 2000, 07:04 AM
Bart Ramos Bart Ramos is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 4 Bart Ramos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I' m trying to setup Apache (1.3.12) with suexec and PHP (4.0.3pl1).

Everything works fine, except one thing:

I use PHP as a script-processor, not as a module. I added an "AddHandler php4-script .php" and an "Action php4-script /cgi-bin/php" which refers to a file "php" in a directory "/usr/local/apache/cgi-bin/" containing only one line:

#! /usr/local/apache/bin/php

In the directory "usr/local/apache/bin/" is the php-executable.

The parsing of the php-files is perfect. But suexec doesn't react at all. I know suexec is working fine, because it does react on a .cgi-file.

As I replace "php4-script" in the AddHandler and Action to "cgi-script", suexec does react. SUexec says: [2000-11-15 10:43:31]: info: (target/actual) uid: (bart/bart) gid: (ftp/ftp).
But php does not get parsed anymore. I get an Internal Server Error.
The error_log file says:

failed to open log file
fopen: Permission denied
[Wed Nov 15 10:43:31 2000] [error] [client xxx.xxx.xx.xx] Premature end of
script headers: /path/to/file/testfile.php

What do I do wrong? Do I need to copy the entire php-executable into each user-directory? And how do I have to tell suexec that php is a script-processor?

Bart

------------------

Reply With Quote
  #2  
Old November 16th, 2000, 07:02 PM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
>>failed to open log file
>>fopen: Permission denied

What is the "ls -Al" output of that log file?

>>Do I need to copy the entire php-executable into each user-directory?

No if that script has 755 permission (-rwxr-xr-x). First, the script needs to give other (world) or group permission to execute it. Then it will executed under the userid. It doesn't matter where the script is.

>>And how do I have to tell suexec that php is a script-processor?

Suexec only execute CGI script under the same userid, you don't need to tell, it will do so. BTW, I thought you already solved this problem with AddHandler and Action to "cgi-script".
You actually can do this:
AddHandler cgi-script .cgi .php
You don't need a separate AddHandler.

Reply With Quote
  #3  
Old November 17th, 2000, 04:26 AM
Bart Ramos Bart Ramos is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 4 Bart Ramos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank you for your reply, freebsd.

>>>failed to open log file
>>>fopen: Permission denied
>What is the "ls -Al" output of that log file?

What log file do you mean? I don' t know what log file is refered to in the httpd_log...

>BTW, I thought you already solved this problem with AddHandler and Action to "cgi-script".
>You actually can do this:
>AddHandler cgi-script .cgi .php
>You don't need a separate AddHandler.

I did not use a separate AddHandler, I did use only one. I deleted the .cgi, but I also tried it with the .cgi added. Neither did work...

------------------

Reply With Quote
  #4  
Old November 17th, 2000, 11:25 AM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
>>What log file do you mean?

You told me "failed to open log file" and that's the one.


Reply With Quote
  #5  
Old November 18th, 2000, 04:39 AM
Bart Ramos Bart Ramos is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 4 Bart Ramos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Within the error_log-file is a line that says:

"failed to open log file"

It doesn't say what log file is being opened.

Besides: I tried the same thing now with "cgiwrap". It fails at the same point: when I do not let the file be treated by the wrapper, it is parsed by php without any problem. But when I do add a wrapper-action (suexec or cgi-wrap, it makes no difference) it gets another uid and then it isn't parsed by php anymore. On the server itself I tried to handle a php-script with another user, and it causes no problem at all...

Reply With Quote
  #6  
Old November 18th, 2000, 09:29 AM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
If the error log says "failed to open log file", obviously it's not the Apache error log that I was talking about. Check your script and see what file it tried to open and give me the "ls -Al" output of that file.
If it's not your script and you don't know at which point it tries to open a file, post that script here.

Reply With Quote
  #7  
Old November 20th, 2000, 12:26 PM
Bart Ramos Bart Ramos is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 4 Bart Ramos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
It was the same with all te scripts. But in the meantime someone solved the problem by writing his own php-wrapper.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > CGI excecution of PHP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway