• Complain

Kurniawan Agus. - PHP and PostgreSQL Programming By Example

Here you can read online Kurniawan Agus. - PHP and PostgreSQL Programming By Example full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Kurniawan Agus. PHP and PostgreSQL Programming By Example
  • Book:
    PHP and PostgreSQL Programming By Example
  • Author:
  • Genre:
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

PHP and PostgreSQL Programming By Example: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "PHP and PostgreSQL Programming By Example" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

PE Press, 2016. 76 p.
This book helps you to get started how to build PHP programs which access PostgreSQL server.The following is highlight topics:
Setting up Development Environment.
Hello World PHP and PostgreSQL.
CRUD Operations.
Working with Image and Blob Data.
Transaction.
Stored Procedures.

Kurniawan Agus.: author's other books


Who wrote PHP and PostgreSQL Programming By Example? Find out the surname, the name of the author of the book and a list of all author's works by series.

PHP and PostgreSQL Programming By Example — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "PHP and PostgreSQL Programming By Example" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Copyright

PHP and PostgreSQL Programming By Example

Agus Kurniawan

1st Edition, 2016

Copyright 2016 Agus Kurniawan

Table of Contents
Preface

In general people use PHP and database MySQL. This book provides alternative approach to build PHP application with database PostgreSQL. It describes how to work with PHP and PostgreSQL and illustrates their use with code examples.

Agus Kurniawan

Berlin, March 2016

1. Setting up Development Environment

This chapter explains how to setup development to develop PHP and PostgreSQL.

1.1 System Environment

We need to setup development environment to develop PHP application with database PostgreSQL. The following is the list of development platform you can use:

  • Linux
  • Mac
  • Windows

In this book, I use Ubuntu, OS X and Windows 10 for testing. I use Apache web server on Linux and Mac. Otherwise, I use IIS web server on Windows platform.

1.1.1 IIS Web Server on Windows Platform

You also must install IIS on your Windows platform. On Windows Client, you can find it on Program and Features. You can see it on Figure below. Then you can find Turn Windows features on or off (red arrow).

After you click Turn Windows features on or off you can obtain a dialog as - photo 1

After you click Turn Windows features on or off you can obtain a dialog as below.

Checked Internet Information Services and World Wide Web Services Dont forget - photo 2

Checked Internet Information Services and World Wide Web Services. Don't forget to checked CGI, ISAPI Extensions and ISAPI Filters. You can checked other several IIS features. If finished, click OK button.

It will install all selected features. If done, you can check web server IIS on Administrative Tools. You can see Internet Information Services (IIS) Manager. Click it and then you can obtain web server IIS dialog, shown in Figure below.

You also can verify installed web server IIS by opening browser and then type - photo 3

You also can verify installed web server IIS by opening browser and then type http://localhost . If success, you can see the result as follows.

112 Apache on Ubuntu and Mac On OS X Apache already installed for you On - photo 4

1.1.2 Apache on Ubuntu and Mac

On OS X , Apache already installed for you. On Ubuntu, you can install it using this command.

$ sudo apt-get update $ sudo apt-get install apache2
1.2 Deploying PHP on Web Server

In this section, we will deploy PHP on web servers. I use IIS and Apache web servers for testing.

Let's go.

1.2.1 IIS for Windows Platform

There are two options to install PHP on IIS. You can install it via Microsoft Web Platform Installer, http://php.iis.net/. After downloaded, you can run it and then you obtain the following dialog.

** this dialog is a sample for Web Platform Installer 4.6.

Click Options and select IIS If done click OK button After that click - photo 5

Click Options and select IIS. If done, click OK button.

After that click Install button to start installation In this book I - photo 6

After that, click Install button to start installation.

In this book, I installed PHP on IIS manually. You can install the latest PHP on web server IIS. How to install?

Firstly, we must install PHP for Windows. You can download it on http://windows.php.net/download/ . You can download it for x86 or x64 and Thread-Safe or Non Thread-Safe. It's recommended to download Non Thread-Safe PHP. After downloaded, you obtain ZIP file (particular PHP version provides installer file). Extract it on the specific folder, for instance, C:\PHP.

The following is a sample result of extracted PHP.

After that we can install PHP Manager for IIS You can download it on - photo 7

After that, we can install PHP Manager for IIS. You can download it on https://phpmanager.codeplex.com/ . If you have install PHP Manager for IIS, you can see PHP Manager on IIS.

Double click PHP Manager Then you can see PHP Manager view Click Register new - photo 8

Double click PHP Manager. Then you can see PHP Manager view. Click Register new PHP version. Navigate to php-cgi.exe file location. If you have extracted PHP file on C:\PHP, you can find it on C:\PHP\php-cgi.exe .

To verify click Check phpinfo and then you obtain a dialog as below - photo 9

To verify, click Check phpinfo() and then you obtain a dialog as below.

Select Default Web Site and URL httplocalhost If done click OK button If - photo 10

Select Default Web Site and URL http://localhost. If done, click OK button.

If success, you can see phpinfo() output. The following is a sample output.

122 Apache for Linux and Mac Platforms For Linux platform you can install - photo 11

1.2.2 Apache for Linux and Mac Platforms

For Linux platform, you can install Apache with PHP using these commands

$ sudo apt-get update $ sudo apt-get install apache2 $ sudo apt-get install php5 libapache2-mod-php5

For Mac, Apache has installed by default. You can enable this service using this command.

$ sudo apachectl start

Then, open a browser and navigate to http://localhost

To install PHP on Mac you can use brew For instance I install PHP 7 with - photo 12

To install PHP on Mac, you can use brew. For instance, I install PHP 7 with PostgreSQL driver using these commands.

$ brew tap homebrew/dupes $ brew tap homebrew/versions $ brew tap homebrew/homebrew-php $ brew install php70 --with-postgresql

After installed PHP, you can verify by checking PHP version using this statement

$ php -v

Now you can configure PHP on Apache Firstly backup your cd etcapache2 - photo 13

Now you can configure PHP on Apache. Firstly, backup your

$ cd /etc/apache2/ $ sudo cp httpd.conf httpd.conf.bak

Now edit httpd.conf file.

$ sudo nano httpd.conf

Disable PHP5 and enable PHP 7 as follows.

#disable PHP5 module #LoadModule php5_module libexec/apache2/libphp5.so #Enable PHP 7 module LoadModule php7_module /usr/local/opt/php70/libexec/apache2/libphp7.so \. php $> SetHandler application/x-httpd-php

Now restart Apache sudo apachectl restart For testing PHP create testphp - photo 14

Now restart Apache.

$ sudo apachectl restart

For testing PHP, create test.php on Document root of Apache.

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «PHP and PostgreSQL Programming By Example»

Look at similar books to PHP and PostgreSQL Programming By Example. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «PHP and PostgreSQL Programming By Example»

Discussion, reviews of the book PHP and PostgreSQL Programming By Example and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.