interview question and answer

May 25, 2012

Test and Configure PHP installation on Fedora server.

Test and Configure PHP installation on Fedora server.

This step by step article show the configuration and confirmation of PHP module on Fedora Core operating system, please note that this configuration may vary base on the operating system and software version version.


1. Confirmation of the PHP installation.

[root@localhost ~]# rpm -q php
php-5.1.6-3
[root@localhost ~]#

Creating PHP information page.


1. Open the default DocumentRoot directory of Apache web server, usually under "/var/www/html/" using x-terminal.

open nautilus using x terminal

[root@localhost ~]# cd /var/www/html/
[root@localhost html]# pwd
/var/www/html
[root@localhost html]# nautilus ./
[root@localhost html]#

2. Then create new empty file by right clicking on mouse button inside the html directory, then click on Create Document -> Empty File.

create empty text document

3. Then rename this empty file to test.php.

rename file test.php

4. Then open the test.php file using text editor, the figure below show that by right clicking mouse button on the test.php file you can choose your favorite text editor to edit the test.php file with.

open with text editor


5. By using your own choice of text editor, start edit and write the code below:
Note: "gedit" is the editor that show in figure below:

phpinfo();
?>

gedit text editor

6. Click save and exit the text editor.

Testing the PHP test.php page.


1. Click on menu tab, Applications -> Internet -> Firefox Web Browser to open web browser, then write http://127.0.0.1/test.phpin address field, then click Go to start browsing and display the PHP configuration.

PHP information page

2. If you see PHP Version 5.1.6 page, the PHP module are running and functioning on your web server, scroll down on the test.php page to view the all PHP configuration and information on the server site.

3. You can try to access the test.php using the same URL from client PC too.

4. Now the testing of installation and configuration of PHP completed :-) .

Note: If the blank page appear after you click go on the address bar, check the permission for the test.php file.

[root@localhost html]# pwd
/var/www/html
[root@localhost html]# ll
total 8
-rw------- 1 root root 22 Feb 24 20:30 test.php

Change the permission of the test.php file to be readable by all / world.

[root@localhost html]# chmod 755 test.php

Confirmation of the permission change.

[root@localhost html]# ll
total 8
-rwxr-xr-x 1 root root 22 Feb 24 20:30 test.php
[root@localhost html]#

The configuration of PHP file are located in "/etc/php.ini", you can edit the PHP configuration file manually.

Related:

Keywords: PHP installation, PHP configuration, PHP information, PHP information page, PHP page, display PHP information, testing PHP installation, php, fedora php.

No comments: