Ero sivun ”Php5/en” versioiden välillä
(Ak: Uusi sivu: Php5) |
(Ak: Uusi sivu: More information on PHP programming [http://php.net/ php.net] and tutorials [http://www.w3schools.com/php/default.aspm w3schools.com]) |
||
(13 välissä olevaa versiota samalta käyttäjältä ei näytetä) | |||
Rivi 1: | Rivi 1: | ||
<languages/> | <languages/> | ||
− | PHP5 (PHP: Hypertext Preprocessor) | + | PHP5 (PHP: Hypertext Preprocessor) is a server-side programming language. It can also be used for general programming, though. |
− | == | + | == Installation == |
=== Debian / Ubuntu === | === Debian / Ubuntu === | ||
− | + | Install PHP5 to Apache: | |
[[aptitude]] install php5 | [[aptitude]] install php5 | ||
− | + | Install PHP5 Nginx: | |
[[apt-get]] install php5-fpm | [[apt-get]] install php5-fpm | ||
Rivi 17: | Rivi 17: | ||
=== Red Hat / CentOS / Fedora === | === Red Hat / CentOS / Fedora === | ||
− | + | Install PHP CentOS | |
yum install php | yum install php | ||
− | + | Restart apache2 | |
/etc/init.d/httpd restart | /etc/init.d/httpd restart | ||
Rivi 27: | Rivi 27: | ||
− | + | More instructions for CentOS https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-centos-6 | |
− | == | + | == Configuration == |
− | PHP5 | + | PHP5 configuration file is under the path (Apache): |
/etc/php5/php.ini | /etc/php5/php.ini | ||
− | PHP5 | + | PHP5 configuration file is under the path (Nginx): |
nano /etc/php5/fpm/php.ini | nano /etc/php5/fpm/php.ini | ||
− | + | You can test the functionality of fphp5 by creating the /var/www/index.php file and putting the following snippet of code in it: | |
<?php | <?php | ||
− | echo "PHP5 | + | echo "PHP5 works" |
?> | ?> | ||
− | + | After this connect to the server and go to the address server_ip-address/index.php (for example, 10.10.10.10/index.php). If you see the text "PHP5 works" then everything works as they're meant to. | |
− | + | More information on PHP programming [http://php.net/ php.net] and tutorials [http://www.w3schools.com/php/default.aspm w3schools.com] |
Nykyinen versio 17. elokuuta 2015 kello 08.45
PHP5 (PHP: Hypertext Preprocessor) is a server-side programming language. It can also be used for general programming, though.
Sisällysluettelo
Installation
Debian / Ubuntu
Install PHP5 to Apache:
aptitude install php5
Install PHP5 Nginx:
apt-get install php5-fpm
Red Hat / CentOS / Fedora
Install PHP CentOS
yum install php
Restart apache2
/etc/init.d/httpd restart
More instructions for CentOS https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-centos-6
Configuration
PHP5 configuration file is under the path (Apache):
/etc/php5/php.ini
PHP5 configuration file is under the path (Nginx):
nano /etc/php5/fpm/php.ini
You can test the functionality of fphp5 by creating the /var/www/index.php file and putting the following snippet of code in it:
<?php echo "PHP5 works" ?>
After this connect to the server and go to the address server_ip-address/index.php (for example, 10.10.10.10/index.php). If you see the text "PHP5 works" then everything works as they're meant to.
More information on PHP programming php.net and tutorials w3schools.com