Re: [PHP] Re: Building sapi_apache2

2005-07-07 Thread Gaby vanhegan


On 6 Jul 2005, at 23:02, Richard Lynch wrote:


I suppose I should go read some documentation about what sapi_apache2
actually means/does...  Nah.  I won't have time to play with it 
anyway.

Why torture myself?


I'll send you a beer?  :)


My current theory, with no supporting evidence whatsoever, is that
sapi_apache2 was a short-lived development feature that Plesk 
unwisely

relied upon to detect Apache 2...


i did read the README's in the apache2handler folder In the source for 
5.0.4, and it did say that the feature was EXPERIMENTAL.  I read 
through the makefiles, and I'm no expert on Make or autoconf, but it 
looks like building an apache SAPI module should include the 
sapi_apache2 module.  I'm at a loss as to why it doesn't get included 
or reported though.


Frustratingly, if I grep the entire Plesk folder for the string 
sapi_apache2:


# grep -r sapi_apache2 ./*
Binary file ./admin/sbin/websrvmng matches
grep: warning: ./admin/conf/conf: recursive directory loop

That's all I get, so it's not even something that I could fix myself... 
:(  Thanks for your help, I appreciate you taking the time to respond.


Gaby

--
Junkets for bunterish lickspittles since 1998!
[EMAIL PROTECTED]
http://weblog.vanhegan.net

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Building sapi_apache2

2005-07-06 Thread Gaby vanhegan


On 6 Jul 2005, at 00:26, Rasmus Lerdorf wrote:


In the Loaded Modules Apache section it will show up as mod_php5.
There is no code that outputs sapi_apache2, so I am not sure where you
are getting that from.  The right way to check the sapi is to call
php_sapi_name() which will return apache for any of the Apache sapis.


This ties in with something I read in a support forum, that Plesk won't 
support php5.  And I also found this:


http://forum.ev1servers.net/showthread.php?t=54861 (IfModule directive 
problem)
http://forum.ev1servers.net/showthread.php?t=56026 (Plesk don't work 
with PHP5)


And a little further investigation shows that I can't find any phpinfo 
pages with php5 and sapi_apache2.  I reckon the one that I thought I 
saw a while back was for php 4.3.10, not php5... :(


I think it's time to start rummaging around in Plesk, to see if I can 
force it to use a different means to detect php, namely the mod_php5 
module instead of sapi_apache2.


Thanks to all who helped, in particular Rasmus and Richard.

Gaby

--
Junkets for bunterish lickspittles since 1998!
[EMAIL PROTECTED]
http://weblog.vanhegan.net

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Building sapi_apache2

2005-07-05 Thread Gaby vanhegan


On 5 Jul 2005, at 15:07, Rasmus Lerdorf wrote:


Gaby vanhegan wrote:

Is there a specific compile switch that I need to build Apache with in
order to allow php5 to see and use the sapi_apache2 module?  I could 
see
nothing specific in a ./configure --help for either Apache or php.  
I

have the rpm .spec file, so I could theoretically do a nice clean
rebuild if I needed to.


First, have you read the documentation?

http://www.php.net/manual/en/install.unix.apache2.php

And no, there is nothing you need to do to your Apache2.  Simply build
PHP using --with-apxs2 and then in your Apache config file, LoadModule
the resulting libphp5.so shared library as per the instructions.


I have read the documentation also, and the module is already 
LoadModule'd into apache.  I've built php from source many times 
before, so I'm fairly familiar with the configuration settings and how 
to get it working in Apache.  The configure settings I used were:


./configure --with-apxs2=/usr/sbin/apxs \
--with-libxml-dir=/usr/lib \
--with-openssl \
--with-zlib \
--enable-bcmath \
--with-bz2 \
--enable-calendar \
--with-curl \
--enable-dbx \
--enable-dio \
--enable-exif \
--enable-ftp \
--with-gd \
--with-ttf \
--enable-gd-native-ttf \
--with-gettext \
--enable-mbstring \
--with-mysql \
--enable-soap

And in /etc/httpd/conf.d/php.conf:

LoadModule php5_modulemodules/libphp5.so

And that is actually loading the correct version of libphp5.so, the one 
that is compiled and installed by my php build.  libphp5.so is loaded, 
but the sapi_apache2 module doesn't exist.  The place where I would 
expect sapi_apache2 to be listed in phpinfo() (the apache2handler 
section) contains this:


Loaded Modules
core prefork http_core mod_so mod_access mod_auth mod_auth_anon 
mod_auth_dbm mod_auth_digest util_ldap mod_auth_ldap mod_include 
mod_log_config mod_env mod_cern_meta mod_expires mod_deflate 
mod_headers mod_usertrack mod_setenvif mod_mime mod_dav mod_status 
mod_autoindex mod_asis mod_info mod_dav_fs mod_vhost_alias 
mod_negotiation mod_dir mod_imap mod_actions mod_speling mod_userdir 
mod_alias mod_webapp mod_rewrite mod_proxy proxy_ftp proxy_http 
proxy_connect mod_cache mod_suexec mod_disk_cache mod_file_cache 
mod_mem_cache mod_cgi mod_perl mod_php5 mod_python mod_ssl mod_fpcgid 
mod_logio


Somebody previously suggested that I rebuild apache with threading 
enabled.  Will this make a difference?


Gaby

--
Junkets for bunterish lickspittles since 1998!
[EMAIL PROTECTED]
http://weblog.vanhegan.net


Re: [PHP] Re: Building sapi_apache2

2005-07-05 Thread Gaby vanhegan


On 5 Jul 2005, at 15:42, Rasmus Lerdorf wrote:


Gaby vanhegan wrote:

Somebody previously suggested that I rebuild apache with threading
enabled.  Will this make a difference?


Yeah, it will likely make everything crash in weird on undebuggable
ways.  (So, don't do that)


I suspected that this was the case, from what I read php5 doesn't work 
with threads yet...



Sounds to me like you are either editing the wrong conf file or putting
that LoadModule line in the wrong place.  Try making a typo in the
LoadModule line and see if you get an error when you restart the 
server.


It is in the right place.  If I remove the LoadModule directive, PHP is 
inactive on the server, and anything ending in .php downloads as a 
plain text file.  To all intents and purposes php5 works fine, it's 
just lacking the sapi_apache2 module.


Gaby

--
Junkets for bunterish lickspittles since 1998!
[EMAIL PROTECTED]
http://weblog.vanhegan.net

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Building sapi_apache2

2005-07-05 Thread Gaby vanhegan


On 5 Jul 2005, at 21:38, Richard Lynch wrote:


./configure --with-apxs2=/usr/sbin/apxs \


Is that really really 100% for sure guaranteed an Apache 2 apxs and not
some left-over Apache 1.x apxs script?...

Isn't the Apache2 apxs named, like, apxs2 ???


That's what I thought, but there's only one apxs on the system, and 
that's it.  There's also only one flavour of Apache installed on the 
system, and thats 2.0.51.  I'm fairly sure that it's right.  I also 
compared the verison of apxs on the system with the one in the source 
tarball for httpd-2.0.54, and they're pretty much the same thing.  
Here's some version information and some file location information, if 
it'll help.


# /usr/sbin/httpd -V
Server version: Apache/2.0.51
Server built:   Nov 12 2004 10:10:20
Server's Module Magic Number: 20020903:9
Architecture:   32-bit
Server compiled with
 -D APACHE_MPM_DIR=server/mpm/prefork
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D HTTPD_ROOT=/etc/httpd
 -D SUEXEC_BIN=/usr/sbin/suexec
 -D DEFAULT_PIDLOG=logs/httpd.pid
 -D DEFAULT_SCOREBOARD=logs/apache_runtime_status
 -D DEFAULT_LOCKFILE=logs/accept.lock
 -D DEFAULT_ERRORLOG=logs/error_log
 -D AP_TYPES_CONFIG_FILE=conf/mime.types
 -D SERVER_CONFIG_FILE=conf/httpd.conf
# locate apxs
/usr/share/man/man8/apxs.8.gz
/usr/share/man/fr/man1/apxs.1.gz
/usr/sbin/apxs
# ls -lFa /usr/sbin | grep apxs
-rwxr-xr-x   1 root root 21528 Nov 12  2004 apxs*
# ls -lFa /usr/sbin | grep httpd
-rwxr-xr-x   1 root root265976 Nov 12  2004 httpd*
-rwxr-xr-x   1 root root274816 Nov 12  2004 httpd.worker*
# yum list installed | grep httpd
httpd   i386   2.0.51-2.9   db
httpd-devel i386   2.0.51-2.9   db


I suppose I should go read some documentation about what sapi_apache2
actually means/does...  Nah.  I won't have time to play with it anyway.
Why torture myself?


I'll send you a beer?  :)

Gaby

--
Junkets for bunterish lickspittles since 1998!
[EMAIL PROTECTED]
http://weblog.vanhegan.net

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] who can do this without the recursion

2005-07-05 Thread Gaby vanhegan


On 5 Jul 2005, at 23:08, Rene Brehmer wrote:

Mostly it impressed me that recursion wasn't cool -- just another 
tool

and one that you only should pull out 1% of the time.


When we learned about recursion it took our teacher 15 minutes to come 
up
with an example for what the heck it was good for ... and it wasn't 
even a

good one (can't remember what it was).


I have a Sudoku solver that requires every single permutation of sets 
of numbers for testing against, which I find a recursive function 
generates extremely quickly.  The main uses I find are, as stated 
before, for building trees of data or doing very abstract problem 
solving.


Gaby

--
Junkets for bunterish lickspittles since 1998!
[EMAIL PROTECTED]
http://weblog.vanhegan.net

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Building sapi_apache2

2005-07-05 Thread Gaby vanhegan


On 6 Jul 2005, at 00:00, Rasmus Lerdorf wrote:


I suspected that this was the case, from what I read php5 doesn't work
with threads yet...


There are simply too many moving parts here to ever be sure that there 
won't be a thread-related race condition somewhere.


Ah ha, this makes more sense to me now.

It is in the right place.  If I remove the LoadModule directive, PHP 
is
inactive on the server, and anything ending in .php downloads as a 
plain

text file.  To all intents and purposes php5 works fine, it's just
lacking the sapi_apache2 module.


Huh?  Lacking it where?  I guess I didn't read the entire thread.  If 
it

is working, then you have the module loaded correctly.


The gist is that the apache2handler is not reporting the sapi_apache2 
anywhere, either in apache or php.  Plesk uses the presence of this 
module to work out if php is installed on the server, and therefore 
turn it on/off.  My client has Plesk so I can't change that.  I've also 
seen other phpinfo() pages where sapi_apache2 is present, so I would 
like to know how to get it compiled/installed in such a way that the 
apache2handler picks it up.


Gaby

--
Junkets for bunterish lickspittles since 1998!
[EMAIL PROTECTED]
http://weblog.vanhegan.net

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Building sapi_apache2

2005-07-04 Thread Gaby vanhegan

Hi,

I have php 5.0.4 running fine on Fedora Core 2 under Apache 2.0.49.  To 
all intents and purposes, PHP works fine.  The only problem I have is 
with Plesk, which uses the presence of the sapi_apache2 module to turn 
PHP on or off for the various sites that it controls:


IfModule sapi_apache2.c
php_admin_flag engine on
	php_admin_value open_basedir 
/home/httpd/vhosts/stells.co.uk/httpdocs:/

/IfModule

The problem is that the sapi_apache2 module isn't built into php.  
phpinfo() shows no mention of this module, but on other systems I have 
seen it compiled in.  How do I build php 5.0.4 to have this module 
included?


I'm sorry for the cross posting, the php-install list was silent on the 
matter, and I'm pretty sure it's not a Plesk related issue.  I have 
already googled extensively for this but with no joy, as well as 
trawled the Plesk support forums and PHP list archives.  Also, as this 
is not my machine, the client requests Plesk, so I can't just turn that 
off.


I'm sure the problem is a very small and minor one, but I just can't 
see it!


Gaby

--
Junkets for bunterish lickspittles since 1998!
[EMAIL PROTECTED]
http://weblog.vanhegan.net

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Report

2005-07-04 Thread Gaby vanhegan


On 4 Jul 2005, at 15:09, Miles Thompson wrote:

There is a lot of JUNK showing up on this list, and for me this one 
was the last straw. From Post Office at [EMAIL PROTECTED] it had 
an attachment named


Likewise on the php-install list as well.  Of the 20 emails I've had 
over the last few days, 3 have been legitimate posts...


Gaby

--
Junkets for bunterish lickspittles since 1998!
[EMAIL PROTECTED]
http://weblog.vanhegan.net

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Building sapi_apache2

2005-07-04 Thread Gaby vanhegan

On 4 Jul 2005, at 19:58, Catalin Trifu wrote:

I have php 5.0.4 running fine on Fedora Core 2 under Apache 2.0.49.  
To

all intents and purposes, PHP works fine.  The only problem I have is
with Plesk, which uses the presence of the sapi_apache2 module to turn
PHP on or off for the various sites that it controls:

IfModule sapi_apache2.c
php_admin_flag engine on
php_admin_value open_basedir
/home/httpd/vhosts/stells.co.uk/httpdocs:/
/IfModule


I think you are looking for IfModule mod_php5.c or IfModule 
mod_php4.c
These are valid in case you compiled and loaded PHP as an Apache 
module.


Catalin


True, but this is Plesk that is doing this, not my Apache 
configuration.  I've seen PHP5 on Apache2 servers that have the 
sapi_apache2 module installed, and the module being listed in 
phpinfo(), but I can't work out how to force it to compile the module 
in...


Gaby

--
Junkets for bunterish lickspittles since 1998!
[EMAIL PROTECTED]
http://weblog.vanhegan.net

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Building sapi_apache2

2005-07-04 Thread Gaby vanhegan


On 4 Jul 2005, at 21:35, Richard Lynch wrote:


On Mon, July 4, 2005 12:14 pm, Gaby vanhegan said:

On 4 Jul 2005, at 19:58, Catalin Trifu wrote:
True, but this is Plesk that is doing this, not my Apache
configuration.  I've seen PHP5 on Apache2 servers that have the
sapi_apache2 module installed, and the module being listed in
phpinfo(), but I can't work out how to force it to compile the module
in...


WILD GUESS ALERT!!!

Maybe that's only on if you've compiled Apache in that threaded 
mode

as aopposed to the non pre-fork mode or whatever it is...

This is nothing more than a guess.


Thank you for the suggestion Richard.  This is something that had 
occurred to me as well, as the httpd was the stock version that shipped 
with Fedora Core 2.  However, there is no mention of sapi_apache2 
anywhere in the httpd source tree for version 2.0.49 (the stock version 
on Fedora Core 2) and on the latest 2.0.51 version.  The only mention 
that I can find is in the php5 source, in the apache2_handler and 
apache2_filter code.


Is there a specific compile switch that I need to build Apache with in 
order to allow php5 to see and use the sapi_apache2 module?  I could 
see nothing specific in a ./configure --help for either Apache or 
php.  I have the rpm .spec file, so I could theoretically do a nice 
clean rebuild if I needed to.


Gaby

--
Junkets for bunterish lickspittles since 1998!
[EMAIL PROTECTED]
http://weblog.vanhegan.net

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php