Overview
KB
Learn PHP
PHP techniques
PHP basics
PHP Tutorial
PHP History
Command Line PHP
PHP Syntax
PHP Variables
PHP Superglobals
PHP Strings

PHP Tutorial

Installing and Configuring Apache with PHP

phpinfo() Results
To make PHP-driven dynamic Web pages available to the public, a Web server, such as Apache, must be installed and configured to support PHP. (However, scripts can be developed and tested in NuSphere's PhpED without a Web server; you can also perform command-line scripting without one.) PHP works with all major Web servers, including Microsoft's IIS, but Apache is the most popular Web server, and PHP the most popular Apache module. Installing and configuring Apache with PHP is not difficult, although version changes in both technologies can complicate the process. Note, again, that you can skip this installation process by just using NuSphere's PhpED, if making your Web pages available to the outside world from your computer is not required. After installing Apache and PHP on a server, you should test and confirm its successful installation. Running a phpinfo() script (see the figure) accomplishes just that, shows you how PHP is configured, and more. Knowing how PHP is configured and how to change PHP's configuration is rudimentary step in developing your Web applications. (To be clear, configuring Apache to recognize PHP is part of the installation process; configuring PHP is a separate issue.) PHP developers may want to change the PHP configuration in order to...

PHP Data Structures

PHP supports eight types of data structures. Half of these are scalar types, meaning they hold only a single value. These are: Booleans (True/False), integers, floating-point numbers, and strings (any quoted character or sequence of characters). PHP supports two non-scalar types: arrays and objects. Arrays are very commonly used, in everything from handling HTML forms to retrieving database query results. Objects are used when performing object-oriented programming. Finally, PHP supports two special types: resources and NULL. Resource types provide a pointer-like reference to database connections, opened files and directories, dynamically-generated images, etc. The NULL type is represented by:
  • the constant NULL
  • a variable not assigned a value
  • a variable that has been unset
Because PHP is a weakly-typed language, a variable's type can be changed on the fly. You cannot declare variables to be a set type, but you can forcibly type-cast them from one type to another. PHP will often automatically change a variable's type as needed, but forcibly casting from one data structure type to another is a simple and smart security technique.

Article continues:  <<previous page  next page>>

 Download NuSphere PHP IDE

Download a free trial of the fast PHP EDitor and robust Integrated Development Environment for PHP.

 Buy NuSphere PhpED® now

Best PHP Editor and complete PHP IDE.
NuSphere PhpED 18.0 is available from our online store front.

 Special Team4 Offer

Get 4 copies of PhpED for the price of 3!

Optimum solution for development teams.
PhpED 18.0 Team4
Need more than 4 licenses? Contact Us for more quantity discounts, please use "Ordering/Payment issue" subject on the form.
"To be honest its bloody awesome, I have looked at loads of PHP editors and this is THE only one that actual works straight out of the box!!! Brilliant, well done."
Andrew Breward,
Director of Technology
caboodal.com