Introduction to PHP and MySQL


What is PHP?

PHP is a widely-used general-purpose server-side scripting language that can be embedded into HTML. You can think of it as a "plug-in" for your Web server that will allow it to do more than just send plain Web pages when browsers request them. With PHP installed, your Web server will be able to read a new kind of file (called a PHP script) that can do things like retrieve up-to-the-minute information from a database and insert it into a Web page before sending it to the browser that requested it. PHP is completely free to download and use. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial.

PHP Home Page



  1. PHPMaker requires PHP >= 5.5.
  2. If you use MySQL, you must install MySQL Improved Extension (mysqli), NOT the old mysql extension which was deprecated in PHP 5.5.0 and was removed in PHP 7.0.0. The old mysql extension is NOT supported by PHPMaker anymore.
  3. If you use Microsoft SQL Server, you must install Microsoft Drivers for PHP for SQL Server.
  4. If you use Microsoft Access, you must install the COM extension.


What is MySQL?

MySQL is a relational database management system, or RDBMS. It has become the world's most popular open source database because of its consistent fast performance, high reliability and ease of use.

MySQL Home Page

Note for MySQL 8 (read Requirements)

When running a PHP version before 7.1.16, or PHP 7.2 before 7.2.4, set MySQL 8 Server's default password plugin to mysql_native_password or else you will see errors similar to The server requested authentication method unknown to the client [caching_sha2_password] even when caching_sha2_password is not used.

This is because MySQL 8 defaults to caching_sha2_password, a plugin that is not recognized by the older PHP (mysqlnd) releases. Instead, change it by setting default_authentication_plugin=mysql_native_password in my.cnf. The caching_sha2_password plugin will be supported in a future PHP release.


Useful MySQL Database Administration Tools

phpMyAdmin (freeware)


Installing PHP and MySQL on Windows

Both PHP and MySQL support various platforms, including Windows.

Note It is recommended that you install MySQL and PHP on your computer so you can easily develop and test your PHP locally before uploading to your production server.

If you have difficulties installing PHP and MySQL, you might try EasyPHP which is an "out of the box" Apache, MySQL, and PHP installation for Windows.

The next step is to set up a valid configuration file for PHP, the php.ini. PHP searches for php.ini in the locations described in The configuration file.

Some Important Settings in php.ini for Using PHP on Windows

extension_dir - In what directory PHP should look for dynamically loadable extensions. It should be set to the folder where your extensions are installed, e.g.

extension_dir="C:\Program Files (x86)\PHP\ext"

session.save_path - This is the path where session data files are stored. Make sure this setting points to an existing folder on your machine, e.g.


upload_tmp_dir - If you want to use file upload, make sure this setting points to an existing folder on your machine, e.g.


php_com_dotnet.dll - If you use MS Access (on Windows server), the COM extension is required. As of PHP 5.5, the COM extension requires php_com_dotnet.dll to be enabled inside of php.ini, i.e.


php_openssl.dll - If you need to work with ssl:// or tls://, make sure you enable OpenSSL support by uncommenting the following line in php.ini:


For better secruity, you should configure openssl.cafile or openssl.capath. You can download a PEM file here and specify it by openssl.cafile, e.g.

openssl.cafile="C:\Program Files (x86)\PHP\cacert.pem"

Note To check your PHP configuration, you can write a simple script and run phpinfo. Make sure the required extensions for your database(s) are properly enabled, e.g. in the PHP info page, find mysqli (for MySQL), pgsql (for PostgreSQL), oci8 (for Oracle), com_dotnet (for MS Access) and openssl.



Configuring Read/Write Permissions

An important aspect of working with file upload to a folder on the web server is to correctly configure Read/Write permissions.

When a web application uses a file, the application must have Read permission to the file so the application can access it. Additionally, the application must have Write permission to the folder that contains the file because new files may be created in the folder at run time.

If you use Linux/Unix, CHMOD your upload folder to "777" by using your FTP software.

To use an Access database in an PHP web application, you must also configure the folder that contains the Access database to have both Read and Write permissions for the web server user account.



 ©2002-2018 e.World Technology Ltd. All rights reserved.