How to configure PHP under the Apache web server in the GENTOO operating system?

is there anyone who knows how to install / configure php under apache?

I have emerge php apache. I wanted to use mod_php for apache on the GENTOO OS.

php temp.php

the command line works fine, but http: //localhost/temp.php is not executed on the web server, but shows the contents of the php code.

+3
source share
5 answers

I found a blog and I followed its instructions and it works! I share the solution Link to Blog

I put these lines in /etc/make.conf:

USE="apache2 mysql php pam ssl xml xml2 berkdb innodb jpeg png"

phpmyadmin, unicode pcre:

USE="apache2 mysql php pam ssl xml xml2 berkdb innodb jpeg png pcre session unicode"

/etc/init.d/apache2, public_html ( ~), -D USERDIR:

APACHE2_OPTS="-D DEFAULT_VHOST -D PHP5 -D USERDIR

mysql ( ) mysql, , :

/usr/bin/mysql_install_db
+5

, , . 1 2010 , , PHP Apache2 Gentoo, Apache PHP :

  • bash$ emerge apache
  • , Gentoo
    • . , Apache PHP :
      • bash$ echo "dev-lang/php apache2" >> /etc/portage/package.use
    • PHP:
      • bash$ echo "dev-lang/php mysql" >> /etc/portage/package.use
    • .
  • bash$ emerge dev-lang/php Apache /etc/init.d/apache2 script. PHP .
+4
+2

Apache 2.0 Unix

,

LoadModule php5_module modules/libphp5.so

SetHandler application/x-httpd-php

: -)

, Apache (Apache 2, PHP 5.2, Ubuntu):

LoadModule php5_module /usr/lib/apache2/modules/libphp-5.2.9.so
<IfModule mod_php5.c>
  AddType application/x-httpd-php .php .phtml
  AddType application/x-httpd-php-source .phps
</IfModule>
+1

Source: https://habr.com/ru/post/1714152/


All Articles