How to make a basic installation of PHP on a server
en:How to make a basic installation of PHP on a server
he:כיצד להפוך את התקנה בסיסית של PHP בשרת
ro:Cum sa faci o instalare de bază a PHP pe un server
ru:Как сделать основные установки PHP на сервере
pl:Jak zrobić podstawowe instalacji PHP na serwerze
ja:どのようにサーバー上の PHP の基本的なインストール
ar:كيفية إجراء تثبيت أساسي من بي إتش بي على خادم
zh:如何使 PHP 服务器上的基本安装
de:Wie erstelle ich eine Standardinstallation von PHP auf einem server
nl:Hoe maak je een eenvoudige installatie van PHP op een server
it:Come fare un'installazione di base di PHP su un server
pt:Como fazer uma instalação básica do PHP em um servidor
es:Cómo hacer una instalación básica de PHP en un servidor
fr:Comment faire une installation de base de PHP sur un serveur
Introduction
This article describes how to perform a basic installation of PHP on a Linux or Windows System. It also shows how long can take a facility of this type and how to test the proper functioning.
Debian
PHP "Classic "
Basic installation PHP
Log into ssh on your server using identifiers that have been sent to you upon delivery of your server. Once connected update APT repositories and proceed with the installation of Apache and PHP :
apt-get update apt-get install apache2 php5
Test PHP
You need to create a test page that you would put in the home directory of your site. Take in this example the file info.php in the directory /var/www/ Create a file info.php and place the following code :
<?php echo phpinfo(); ?>
Then, test the page by launching a Web browser :http://X.X.X.X/info.php
By replacing X.X.X.X by the IP address of your server. The IP address must be open to the client which test to connect to the server-level as well as at the level of any firewalls.
You must have a return as follows :
This allows you to also know the modules currently installed on your server.
PHP - FPM
Basic installation PHP - FPM
Log into ssh on your server using identifiers that have been sent to you upon delivery of your server. Once connected update APT repositories and proceed with the installation of php - fpm :
apt-get install apache2 php5-fpm libapache2-mod-fastcgi apache2-mpm-worker service apache2 restart
If you are testing a php site you should have an error 500. So you want to change the configuration of php - fpm file :
vim /etc/apache2/mods-available/fastcgi.conf
10<IfModule mod_fastcgi.c>
11 AddHandler php5.fcgi .php
12 Action php5.fcgi /php5.fcgi
13 Alias /php5.fcgi /usr/lib/cgi-bin/php5.fcgi
14 FastCgiExternalServer /usr/lib/cgi-bin/php5.fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization -idle-timeout 3600
15</IfModule>
Then restart apache and php - fpm services to take into account changes :
service apache2 restart && sudo service php5-fpm restart
Test PHP - FPM
The test remains the same as for a typical php installation. See : fr:Comment_faire_une_installation_de_base_de_PHP_sur_un_serveur#Test PHP
Windows
Being drafted
Source
Fast CGI :
- https://help.ubuntu.com/community/HelpOnInstalling/FastCgi
- https://howto.biapy.com/fr/debian-gnu-linux/serveurs/php/installer-php-fpm-sur-debian
- https://www.nginx.com/resources/wiki/start/topics/examples/phpfcgi/#
- https://www.vincentliefooghe.net/content/configuration-apache-24-php-fpm
- http://askubuntu.com/questions/378734/how-to-configure-apache-to-run-php-as-fastcgi-on-ubuntu-12-04-via-terminal
Enable comment auto-refresher