Mainos / Advertisement:

Ero sivun ”Php5/en” versioiden välillä

Kohteesta Taisto
Siirry navigaatioon Siirry hakuun
(Ak: Uusi sivu: You can test the functionality of fphp5 by creating the /var/www/index.php file and putting the following snippet of code in it:)
(Ak: Uusi sivu: <?php echo "PHP5 works" ?>)
Rivi 43: Rivi 43:
  
 
   <?php
 
   <?php
   echo "PHP5 toimii"
+
   echo "PHP5 works"
 
   ?>
 
   ?>
  

Versio 17. elokuuta 2015 kello 08.43

Muut kielet:
English • ‎suomi

PHP5 (PHP: Hypertext Preprocessor) is a server-side programming language. It can also be used for general programming, though.

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"
 ?>

Tämän jälkeen muodosta yhteys palvelimeen ja mene osoitteeseen palvelimen_ip-osoite/index.php (esim. 10.10.10.10/index.php). Jos teksti "PHP5 toimii" näkyy, sivusto toimii.

Lisätietoa PHP ohjelmoinnista php.net ja tutoriaaleja w3schools.com

Mainos / Advertisement: