PHP

From XennisWiki
Jump to: navigation, search

PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language. (Wikipedia)

Installation

Arch Linux

pacman -S php

Debian

See also: Setting up a Web Server (with Apache, PHP, Git, Redmine, etc.)

Install the php7.0 package:

apt-get install php7.0

Windows

Further information: How to Install PHP on Windows

PHP only

Furher information: Installation on Windows systems, Command Line PHP on Microsoft Windows

All-in-One packages

Distribution containing Apache, PHP, MySQL and other application:

IDEs

Examples

A simple Hello World example:

<?php
  echo 'Hello World'
?>

Include a php file:

<?php
  include 'myFile.php'
  // do something
?>

PHP Extension Community Library (PECL)

Installation

Compiling with PECL

cd extname
phpize [--with-php-config=/usr/local/bin/php-config]
./configure [--with-php-config=/usr/local/bin/php-config]
make

Now a "modules/extname.so" was created.

Install the library

make install

See also

External links