Bug 81699 - www/pserv's PHP support only works with php-cgi SAPI
Summary: www/pserv's PHP support only works with php-cgi SAPI
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Alex Dupre
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-31 08:10 UTC by Vasil Dimov
Modified: 2007-07-02 13:50 UTC (History)
1 user (show)

See Also:


Attachments
pserv_php.diff (1.12 KB, patch)
2005-05-31 08:10 UTC, Vasil Dimov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vasil Dimov 2005-05-31 08:10:01 UTC
www/pserv genereates bogus headers in the http-response if PHP with CLI
SAPI is installed.

In the included patch OPTIONS= was removed, because it is not possible
to use it for the following reasons:

1. WITH_PHP must be tested AFTER including bsd.port.pre.mk
2. USE_PHP and WANT_PHP_CGI must be set BEFORE including bsd.port.pre.mk
3. USE_PHP and WANT_PHP_CGI must be set with ".if defined(WITH_PHP)" test

You see - 3. conflicts with 1. & 2.
The solution is to remove 1. condition and propmt the user to set
WITH_PHP BEFORE we include bsd.port.pre.mk (as done in many ports).

How-To-Repeat: 
% php -v
PHP 4.3.11 (cli) (built: May 31 2005 09:34:26)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

% echo -ne "GET /tmp/test.php HTTP/1.1\r\n\r\n" |socket localhost 8080
HTTP/1.0 200 OK
Connection: close
Date: Tue, 31 May 2005 09:38:30 EEST
Server: pServ/3.3
phpinfo()
PHP Version => 4.3.11

System => FreeBSD sinanica.bg.datamax 5.4-STABLE FreeBSD 5.4-STABLE #6: Tue May 10 12:46:25 EEST 2005     root@sinanica.bg.datamax:/usr/obj/usr/src/sys/SINANICA-SMP i386
...


You see, this is totally incorrect. It should be:


% echo -ne "GET /tmp/test.php HTTP/1.1\r\n\r\n" |socket localhost 8080
HTTP/1.0 200 OK
Connection: close
Date: Tue, 31 May 2005 09:41:07 EEST
Server: pServ/3.3
Content-type: text/html
X-Powered-By: PHP/4.3.11

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html><head>
...

% php -v
PHP 4.3.11 (cgi) (built: May 31 2005 09:18:03)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
Comment 1 Florent Thoumie freebsd_committer freebsd_triage 2005-05-31 09:36:15 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ale

Over to maintainer.
Comment 2 dfilter service freebsd_committer freebsd_triage 2007-07-02 13:49:27 UTC
ale         2007-07-02 12:49:20 UTC

  FreeBSD ports repository

  Modified files:
    www/pserv            Makefile 
  Log:
  Add php-cgi dependency.
  
  PR:             ports/81699
  Submitted by:   vd
  
  Revision  Changes    Path
  1.13      +5 -0      ports/www/pserv/Makefile
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 3 Alex Dupre freebsd_committer freebsd_triage 2007-07-02 13:49:38 UTC
State Changed
From-To: open->closed

Fixed.