Apache Modules PHP
From Gentoo Linux Wiki
|
|
|
Main Modules
Addons & Tunnels Tips Configuring Other |
| edit |
[edit] Prerequsites
[edit] USE Flags
PHP has a lot of USE flags to choose from, for most users the default is sufficient, however you may want to add more. USE flags for dev-lang/php
When adding USE flags for PHP it is best to include them in your /etc/make.conf or your /etc/portage/package.use file.
[edit] Installing
To install PHP: (This will install mod_php, if you want the CLI version as well just add cli below in package.use)
First add dev-lang/php apache2 to /etc/portage/package.use.
echo "dev-lang/php apache2" >> /etc/portage/package.use
Then run
emerge dev-lang/php
This can take a very long time on a slower system.
[edit] Apache
| File: /etc/conf.d/apache2 |
APACHE2_OPTS="-D DEFAULT_VHOST -D PHP5" |
Restart apache after making these changes so that they take effect by issuing: /etc/init.d/apache2 restart
[edit] Testing
A simple php page with the following code should help you to test your PHP configuration
| File: /var/www/localhost/htdocs/phpinfo.php |
<?php phpinfo(); ?> |
And now open your little phpinfo-File with your Browser over your apache. http://localhost/phpinfo.php
Surfing to this page should yield a nice informational page about your PHP installation.
Tip: If you get a web page with a Permission denied error in the rendered text and not a nice information page you may need to adjust the permissions on this file.
