Difference between revisions of "SRA840 Lab6"

From CDOT Wiki
Jump to: navigation, search
(Varinder Singh)
Line 24: Line 24:
 
'''Alternative'''
 
'''Alternative'''
  
Then I have installed PHP5 with Pkg_add method
+
I have installed PHP5 with Pkg_add method
  
#pkg_add -r php5
+
pkg_add -r php5
 +
 
 +
'''PHP configuration'''
 +
 
 +
A) Edit Apache configuration file for PHP Configuration.
 +
 
 +
Step1: Edit the httpd.conf file make Apache aware that PHP is installed.
 +
 
 +
vi usr/local/etc/apache22/httpd.conf
 +
 
 +
Step2: Put the following code in httpd.conf, near the DirectoryIndex
 +
 
 +
<IfModule dir_module>
 +
  DirectoryIndex index.php index.html
 +
</IfModule>
 +
 
 +
 
 +
Step 3: Insert the the following lines towards the end of the file
 +
 
 +
AddType application/x-httpd-php .php
 +
AddType application/x-httpd-php-source .phps
 +
 
 +
Step 4: Copy php.ini-recommended to php.ini
 +
 
 +
cp /usr/local/etc/php.ini-recommended /usr/local/etc/php.ini
 +
 
 +
'''B) Configure php.ini to save its sessions'''
 +
 
 +
Step1: Edit php.ini so PHP knows where to put its session files
 +
 
 +
vi usr/local/etc/php.ini
 +
 
 +
Step2: Uncomment the following line
 +
 
 +
session.save_path = "/tmp"
 +
 
 +
 
 +
'''C)Testing PHP Configuration''' 
 +
 
 +
Step1: It is Just displaying the file contents.I think its not running it. Means the command
 +
 
 +
elinks http://127.0.0.1/phpinfo.php 
 +
 
 +
Just show me the following output
 +
 
 +
<?php phpinfo(); ?>

Revision as of 16:09, 5 April 2009

Varinder Singh

Installing php5

I have tried to install the php5 as described in lab instructions.

#/usr/ports/lang/php5/make install clean

It gives me the error message during installation OR Some time my FreeBSD virtual machine Crashes during installation. I am using Virtual box.I have tried installing new FreeBSD with standard option. It crashes at first time. Any hint, suggestions to this problem would be really appreciated.

The error message i got is.. can't cd to /usr/ports/devel/autoconfig262/work/autoconfig-2.62:No such file or directory patch patch-autoconf.texi fail to apply cleanly.

Error code 1

Stop in /usr/ports/devel/autoconf262.

Error code 1

Stop in /usr/ports/lang/php5.

Error code 1 Stop in /usr/ports/lang/php5.

Alternative

I have installed PHP5 with Pkg_add method

pkg_add -r php5

PHP configuration

A) Edit Apache configuration file for PHP Configuration.

Step1: Edit the httpd.conf file make Apache aware that PHP is installed.

vi usr/local/etc/apache22/httpd.conf

Step2: Put the following code in httpd.conf, near the DirectoryIndex

<IfModule dir_module>
  DirectoryIndex index.php index.html
</IfModule>


Step 3: Insert the the following lines towards the end of the file

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Step 4: Copy php.ini-recommended to php.ini

cp /usr/local/etc/php.ini-recommended /usr/local/etc/php.ini

B) Configure php.ini to save its sessions

Step1: Edit php.ini so PHP knows where to put its session files

vi usr/local/etc/php.ini

Step2: Uncomment the following line

session.save_path = "/tmp"


C)Testing PHP Configuration

Step1: It is Just displaying the file contents.I think its not running it. Means the command

elinks http://127.0.0.1/phpinfo.php  

Just show me the following output

<?php phpinfo(); ?>