PHP
From openSUSE
| PHP | |
|---|---|
![]() Server Side scripting language | |
| Developer: | PHP Group |
| Package Info (pin) | |
| License: | PHP License |
| Website: | http://www.php.net/ |
PHP is a Hypertext Server Side programming language originally developed in 1995 by a Danish-Greenlander by the name of Rasmus Lerdorf. While there is no formal standard, the PHP Group is now considered to be the trusted developer and distributer of PHP software. [1] The two main methods of installation for PHP on OpenSUSE systems are alone: installing only the PHP package; or, with Apache, MySQL, Pyrl and Python with the LAMP package. Both methods are explained below. For more information on the history of PHP and for further support on the scripting language, view the links below.
Resources, such as an online version and downloadable version of the PHP Manual can also be found on the PHP Group website. For more information on the PHP Manual, refer to the PHP Manual section found on the lower portion of this page.
Contents |
Installation
As described in the Introduction section, the two main methods for installing PHP are alone and together with the LAMP package. While installing PHP alone requires less packages, and subsequently less space, if you intend to turn your OpenSUSE system into a public or personal server, then the LAMP pattern would be the best method. It is all up to personal preference, so both methods are described below.
Standalone PHP Installation
To install the core PHP package, first we need to add the PHP repository to YaST/Zypper. To do this, open YaST and enter your root password. After a few seconds of loading, a new window will appear. Click the Software heading in the left column and then Software Repositories. Wait for the repositories to refresh, and then you will be presented with the currently used repositories. Click the Add button on the bottom of the window and select Specify URL.... Enter the URL below that corresponds to your version of OpenSUSE and then name the repository (no specific name is needed, but enter one that it distinguishable). After adding the repository, the list will refresh, and then you can close the Software Repository.
| Version: 11.0
| http://download.opensuse.org/repositories/server:/php/server_apache_openSUSE_11.0/ |
| Version: 10.3
| http://download.opensuse.org/repositories/server:/php/server_apache_openSUSE_10.3/ |
Once the repository has been added, open YaST Package Manager (which can be found in the Software heading under Software Management. Once the repositories refresh, and the package manager loads, enter into the search field php5 (because php5 is the current stable release version; a list of stable versions can be found on the top-left of the PHP Group website linked above in the Introduction section). If a newer stable release is available, use that version. A list of packages containing the name the searched term will appear. Select the following package and click the Install button...
- php5
This package is the core package for version 5 of PHP. You can also the extension packages for php5. These are denoted with a dash and the name of the extension (php5-*). While there are many of these packages, they can be useful. Weather you choose to install them is completely up to you. Once you have finished selecting packages for installation, press the Apply to install the packages. The time for this process many vary on how many packages have been selected for installation.
Together with LAMP
For those who are unfamiliar with web-based servers, LAMP is an acronym for Linux Apache MySQL and PHP (Perl and Python are commonly included as well). This is one of the most popular setups for public web-based or web-hosting servers. Because PHP is included in this, it is a viable method, and with all the other components of a web server included, a suggested way of installing a usable version of PHP. To install Lamp on your OpenSUSE system (based on an 11.0 installation, so lower versions may require adjustments to the process), simply follow the steps below:
- Open YaST Package Manager and enter root password
- Wait for repositories to refresh
- Click the dropdown menu labeled Groups
- Select Patterns instead
- Scroll down in the left column to the heading: Server Functions
- Select the pattern: Web and LAMP Server
- Press the button: Install All
- Press the Apply button to install the packages
This will install all the required files and packages to run a Web and LAMP server, including PHP. For more information on how to configure Apache and the LAMP server as a whole, please visit the pages linked below. This will make the process of configuring and running a LAMP server much easier and smoother.
For the most current packages, add the following repositories...
OpenSUSE 11.0 Repositories
| Version: Apache
| http://download.opensuse.org/repositories/Apache/openSUSE_11.0 |
| Version: Database
| http://download.opensuse.org/repositories/server:/database/openSUSE_11.0 |
| Version: PHP
| http://download.opensuse.org/repositories/server:/php/server_database_apache_openSUSE_11.0 |
OpenSUSE 10.3 Repositories
| Version: Apache
| http://download.opensuse.org/repositories/Apache/openSUSE_10.3 |
| Version: Database
| http://download.opensuse.org/repositories/server:/database/openSUSE_10.3 |
| Version: PHP
| http://download.opensuse.org/repositories/server:/php/server_database_apache_openSUSE_10.3 |
While installing the LAMP server packages without the repositories above will provide a recent version of the server, if the server is being used to host a website, weather private or public, it is a good idea to have the most recent version of the packages. Adding these repositories will also make updating the server much easier.
PHP Manaual
A great tool provided by the PHP Group is the PHP Manual. This manual provides useful information on the syntaxes, functions, commands and many more important PHP topics. There is an online version of the Manual found on the PHP website (link found below), but the CHM file can be more intuitive. This CHM file allows you to search for individual syntaxes and PHP commands, rather than searching through the table of contents to find what you are looking for. This CHM file requires a CHM reader to view. There are two CHM programs that can be used: KchmViewer (KDE) and Chmsee (Gnome). Do to the indexing function of KchmViewer, it can prove to be a better searcher for syntaxes. Both 1-click installers can be found below:
KchmViewer:
| Version: 11.0
| http://software.opensuse.org/ymp/openSUSE:11.0/standard/kchmviewer.ymp |
| Version: 10.3
| http://software.opensuse.org/ymp/openSUSE:10.3/standard/kchmviewer.ymp |
Chmsee:
| Version: 11.0
| http://software.opensuse.org/ymp/openSUSE:11.0/standard/chmsee.ymp |
| Version: 10.3
| http://software.opensuse.org/ymp/openSUSE:10.3/standard/chmsee.ymp |
Once you have installed one of the CHM viewers, download the the CHM file for PHP Manual (link provided below: select a mirror from the list provided). Due to the fact that KchmViewer is more intuitive, the following steps are explained using this KDE program. When you open KchmViewer, it will prompt you to select a CHM file: open the location of where you saved the PHP Manual CHM file to, and select the file. Select the Index tab on the top left of the KchmViewer window. Now you can search individual syntaxes and functions of PHP. This can be invaluable when learning PHP or working with both simple and complex PHP scripts.


