Hey all, i've installed Apache2 by : $ sudo port install php5 +apache2 +mysql5 then, i did : stop Apple's default Apache ; chane firewall setup following <http://edu.ca.edu/article72.html> in particular,adding : <http://edu.ca.edu/IMG/png/coupe-feu-nouveau.png> cp httpd.conf-sample to httpd.conf edit it to my needs including : AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps into <IfModule mime_module> did a : $ sudo /opt/local/apache2/bin/apxs -a -e -n "php5" libphp5.so;sudo cp /opt/local/etc/php.ini-dist /opt/local/etc/php.ini resulting in : [activating module `php5' in /opt/local/apache2/conf/httpd.conf] and finally : sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist NOW, Apache2 is working well fot html and xhtml pages HOWEVER, when pointing a browser to : <http://www.une-bevue.fr/PHP/info.php> the browser (either firefox or webkit) asks me what i want to do with this file either Open it with an Application or Save it somewhere. I think i've missed something here but what ??? best, Yvon
On Apr 24, 2007, at 03:37, Yvon Thoraval wrote:
i've installed Apache2 by :
$ sudo port install php5 +apache2 +mysql5
then, i did :
stop Apple's default Apache ; chane firewall setup following <http://edu.ca.edu/article72.html> in particular,adding : <http://edu.ca.edu/IMG/png/coupe-feu-nouveau.png>
cp httpd.conf-sample to httpd.conf
edit it to my needs including :
AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps
into <IfModule mime_module>
did a :
$ sudo /opt/local/apache2/bin/apxs -a -e -n "php5" libphp5.so;sudo cp /opt/local/etc/php.ini-dist /opt/local/etc/php.ini
resulting in :
[activating module `php5' in /opt/local/apache2/conf/httpd.conf]
and finally :
sudo launchctl load -w /Library/LaunchDaemons/ org.macports.apache2.plist
NOW, Apache2 is working well fot html and xhtml pages HOWEVER, when pointing a browser to :
<http://www.une-bevue.fr/PHP/info.php>
the browser (either firefox or webkit) asks me what i want to do with this file either Open it with an Application or Save it somewhere.
I think i've missed something here but what ???
Sounds like you're almost there. Let me see what I have in my apache2 httpd.conf, which is working fine with php5. Near the other LoadModule directives at the top, you'll need this: LoadModule php5_module modules/libphp5.so You'll want to make sure your DirectoryIndex directive looks something like this: <IfModule dir_module> DirectoryIndex index.php index.html </IfModule> And of course what you already put in the IfModule section: AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps Those are the only applicable occurrences of "php" in my httpd.conf so hopefully that would do it for you too.
Le 24 avr. 07 à 11:13, Ryan Schmidt a écrit :
Sounds like you're almost there. Let me see what I have in my apache2 httpd.conf, which is working fine with php5.
Near the other LoadModule directives at the top, you'll need this:
LoadModule php5_module modules/libphp5.so
obviously i've it.
You'll want to make sure your DirectoryIndex directive looks something like this:
<IfModule dir_module> DirectoryIndex index.php index.html </IfModule>
here i've : # Modifie le 24-04-07 => modified today ##################### <IfModule dir_module> DirectoryIndex index.html index.xhtml index.php index.rhtml </IfModule>
And of course what you already put in the IfModule section:
AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps
here : <IfModule mime_module> TypesConfig conf/mime.types AddType application/x-compress .Z AddType application/x-gzip .gz .tgz # Modifie le 24-04-07 => modified today AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps </IfModule>
Those are the only applicable occurrences of "php" in my httpd.conf so hopefully that would do it for you too.
i think so too ;-) the only file i've left from previous Apache 1.3 install is a .htaccess in my root directory (/Users/yt/Sites/) : $ ls -al /Users/yt/Sites/.* -rw-r--r-- 1 yt yt 15364 Apr 9 11:01 /Users/yt/Sites/.DS_Store -rw-r--r-- 1 yt yt 288 Apr 19 09:40 /Users/yt/Sites/.htaccess -rw-r--r-- 1 yt yt 0 Apr 23 22:27 /Users/yt/Sites/.htgroups -rw-r--r-- 1 yt yt 0 Apr 23 22:27 /Users/yt/Sites/.htusers -rwxr-xr-x 1 yt yt 0 Feb 23 09:05 /Users/yt/Sites/.localized $ cat /Users/yt/Sites/.htaccess AddType text/html .xhtml RewriteEngine on RewriteBase / RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml RewriteCond %{HTTP_ACCEPT} !application/xhtml\+xml\s*;\s*q=0 RewriteCond %{REQUEST_URI} \.xhtml$ RewriteCond %{THE_REQUEST} HTTP/1\.1 RewriteRule .* - [T=application/xhtml+xml] $ cat /Users/yt/Sites/.htgroups $ cat /Users/yt/Sites/.htusers $ obviously i've changed the root path accordingly into httpd.conf : # Modifie le 24-04-07 ##################### #DocumentRoot "/opt/local/apache2/htdocs" DocumentRoot "/Users/yt/Sites" # Modifie le 24-04-07 ##################### <Directory "/Users/yt/Sites"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> # Modifie le 24-04-07 ##################### # was : "/opt/local/apache2/cgi-bin" <Directory "/Users/yt/Sites/cgi-bin"> AllowOverride None Options None Order allow,deny Allow from all </Directory> this sounds "strange" to me ))) also i've added a symlink to the Apache 2 manual : $ ls -al /Users/yt/Sites/manual lrwxr-xr-x 1 yt yt 25 Apr 24 09:53 /Users/yt/Sites/manual -> /opt/ local/apache2/manual BUT when pointing a browser to that directory (saying : http:// www.une-bevue.fr/manual) i get : URI: index.html.de Content-Language: de Content-type: text/html; charset=ISO-8859-1 [...] text/html; charset=ISO-8859-1 instead of the french version of Apache 2 manual (what i had before for v 1.3) anyway, thanks for your help ! Yvon
Le 24 avr. 07 à 11:13, Ryan Schmidt a écrit :
Sounds like you're almost there. Let me see what I have in my apache2 httpd.conf, which is working fine with php5.
Near the other LoadModule directives at the top, you'll need this:
LoadModule php5_module modules/libphp5.so
NO that was the trick i had to put the absolute PATH of libphp5.so : ------------------------------------------------- ^^^^^^^^---------------------------- LoadModule php5_module /opt/local/apache2/modules/libphp5.so instead of the default relative PATH : LoadModule php5_module modules/libphp5.so ALSO, i've to mention it seems the file : /opt/local/apache2/conf/extras-conf/mod_php.conf which contains : $ cat conf/extras-conf/mod_php.conf <IfModule mod_php5.c> AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps </IfModule> IS UNUSED might be because their is no "mod_php5.c" at all ? then i leave : AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps in the httpd.conf file. best, Yvon
In your httpd.conf file have you got the Server Root set correctly? ServerRoot "/opt/local/apache2" If putting the full (absolute) path fixes php5 module, then it probably means that Apache isn't find any of its other modules either ... Mark -- At 12:53 +0200 25/4/07, Yvon Thoraval wrote:
Le 24 avr. 07 à 11:13, Ryan Schmidt a écrit :
Sounds like you're almost there. Let me see what I have in my apache2 httpd.conf, which is working fine with php5.
Near the other LoadModule directives at the top, you'll need this:
LoadModule php5_module modules/libphp5.so
NO that was the trick i had to put the absolute PATH of libphp5.so : -------------------------------------------------^^^^^^^^----------------------------
LoadModule php5_module /opt/local/apache2/modules/libphp5.so
instead of the default relative PATH :
LoadModule php5_module modules/libphp5.so
ALSO, i've to mention it seems the file :
/opt/local/apache2/conf/extras-conf/mod_php.conf
which contains :
$ cat conf/extras-conf/mod_php.conf <IfModule mod_php5.c>
AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps
</IfModule>
IS UNUSED might be because their is no "mod_php5.c" at all ?
then i leave :
AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps
in the httpd.conf file.
best,
Yvon
_______________________________________________ macports-users mailing list macports-users@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo/macports-users
On Wed, 25 Apr 2007 21:51:47 +0100 Mark Hattam <mark@dxradio.demon.co.uk> wrote:
In your httpd.conf file have you got the Server Root set correctly?
ServerRoot "/opt/local/apache2"
If putting the full (absolute) path fixes php5 module, then it probably means that Apache isn't find any of its other modules either ...
Y're right, i do have : ServerRoot "/opt/local/apache2" but my : LoadModule php5_module /opt/local/apache2/modules/libphp5.so might be only some sort of workaround where i've corrected only the symptom not the true cause of the prob. i say that because i did a symlink for the manual : ~/Sites%> ls -al manual lrwxr-xr-x 1 yt yt 25 Apr 24 09:53 manual -> /opt/local/apache2/manual my DocumentRoot being set to /Users/yt/Sites and when i point a browser to the url : http://www.une-bevue.fr/manual instead of having the manual page, in french in my case, i get : URI: index.html.de Content-Language: de Content-type: text/html; charset=ISO-8859-1 <snip /> URI: index.html.pt-br Content-Language: pt-br Content-type: text/html; charset=ISO-8859-1 which means another module isn't working (all modules, afaik, are in /opt/local/apache2/modules) then, i'm lost about this question absolute PATH versus php5 working ... thanks, Yvon
On Apr 25, 2007, at 18:18, Thoraval Yvon wrote:
On Wed, 25 Apr 2007 21:51:47 +0100 Mark Hattam wrote:
In your httpd.conf file have you got the Server Root set correctly?
ServerRoot "/opt/local/apache2"
If putting the full (absolute) path fixes php5 module, then it probably means that Apache isn't find any of its other modules either ...
Y're right, i do have :
ServerRoot "/opt/local/apache2"
but my :
LoadModule php5_module /opt/local/apache2/modules/libphp5.so
might be only some sort of workaround where i've corrected only the symptom not the true cause of the prob.
I cannot explain why you would have to use the absolute path. According to the documentation in httpd.conf, that should not be necessary: # Configuration and logfile names: If the filenames you specify for many # of the server's control files begin with "/" (or "drive:/" for Win32), the # server will use that explicit path. If the filenames do *not* begin # with "/", the value of ServerRoot is prepended -- so "logs/foo.log" # with ServerRoot set to "/opt/local/apache2" will be interpreted by the # server as "/opt/local/apache2/logs/foo.log". "LoadModule php5_module modules/libphp5.so" should be sufficient. It works fine for me. Are you *sure* ServerRoot is set correctly? Perhaps you have defined it twice? Perhaps not even in the main httpd.conf but in some other conf file that's being included?
i say that because i did a symlink for the manual :
~/Sites%> ls -al manual lrwxr-xr-x 1 yt yt 25 Apr 24 09:53 manual -> /opt/local/apache2/ manual
my DocumentRoot being set to /Users/yt/Sites
and when i point a browser to the url :
http://www.une-bevue.fr/manual
instead of having the manual page, in french in my case, i get :
URI: index.html.de Content-Language: de Content-type: text/html; charset=ISO-8859-1 <snip /> URI: index.html.pt-br Content-Language: pt-br Content-type: text/ html; charset=ISO-8859-1
which means another module isn't working (all modules, afaik, are in /opt/local/apache2/modules)
then, i'm lost about this question absolute PATH versus php5 working ...
You do not need to create a symlink called "manual" in your document root to get manual support. You should remove your "manual" symlink and instead uncomment (remove the "#" before) this one line in httpd.conf: #Include conf/extra/httpd-manual.conf This does require the modules mod_alias, mod_setenvif and mod_negotiation.
On Thu, 26 Apr 2007 04:31:38 -0500 Ryan Schmidt <ryandesign@macports.org> wrote:
"LoadModule php5_module modules/libphp5.so" should be sufficient. It works fine for me.
YES i agree with you but...
Are you *sure* ServerRoot is set correctly? Perhaps you have defined it twice? Perhaps not even in the main httpd.conf but in some other conf file that's being included?
i've that : ServerRoot "/opt/local/apache2" ONLY ONE time in /opt/local/apache2/conf/httpd.conf and also all of the : # Server-pool management (MPM specific) #Include conf/extra/httpd-mpm.conf are commented out with a #. the other httpd.conf (for Apache2) are : /opt/local/apache2/conf/httpd.conf.sample /opt/local/apache2/conf/original/httpd.conf and all of those have the same ServerRoot value, i think the value "/opt/local/apache2" has been set by MacPort. i did change myself DocumentRoot only... looks strange to me. best, Yvon
participants (4)
-
Mark Hattam
-
Ryan Schmidt
-
Thoraval Yvon
-
Yvon Thoraval