Install PHP on Ubuntu 12.04
Log In or Register to download the BES file, and more.

0 Votes

Collections (part of 1 collection)

Ubuntu

Description

Step 1 In the terminal copy/paste the following line:

sudo gedit /var/www/testphp.php

This will open up a file called phptest.php.

Step 2 Copy/Paste this line into the phptest file:

<?php phpinfo(); ?>

Step 3 Save and close the file.

Step 4 Now open you're web browser and type the following into the web address:

http://localhost/testphp.php

Extra:

In order to phpmyadmin works, you need to copy it to www:

sudo cp -R /usr/share/phpmyadmin /var/www

so, you can use it typing: http://localhost/phpmyadmin at your prefered browser.


Property Details

ID1432
TitleInstall PHP on Ubuntu 12.04
DomainBESC
CategoryInstallation
Sourcedanielheth@bigfix.me
Source ID<Unspecified>
Source Severity<Unspecified>
Source Release Date4/27/2013 12:00:00 AM
KeywordsStep php command SPAN testphp
Is TaskTrue
Added by on 5/1/2013 10:07:38 PM
Last Modified by on 5/1/2013 10:08:43 PM
Counters 4750 Views / 11 Downloads
User Rating 1 star 2 star 3 star 4 star 5 star * Average over 0 ratings. ** Log In or Register to add your rating.

Relevance

Used in 11 fixlets and 1 analsis   * Results in a true/false
Show indented relevance
name of operating system contains "Ubuntu"
Used in 1 fixlet   * Results in a true/false
Show indented relevance
exists file "availableApps.txt" whose (exists lines whose (it starts with "php5") of it) of parent folder of client
Used in 1 fixlet   * Results in a true/false
Show indented relevance
NOT exists file "installedApps.txt" whose (exists lines whose (it starts with "php5") of it) of parent folder of client
Used in 3 fixlets   * Results in a true/false
Show indented relevance
exists file "installedApps.txt" whose (exists lines whose (it starts with "apache2") of it) of parent folder of client

Actions

Action 1 (default)

Action Link Click here to deploy this action.
Script Type BigFix Action Script
//install php
delete __appendfile
appendfile #!/bin/sh
delete "libapache2-mod-php5.txt"
appendfile apt-get install -q -y libapache2-mod-php5 > libapache2-mod-php5.txt
//to provide additional extendability... it's nice to always have certain modules installed
delete "php5-gd.txt"
appendfile apt-get install -q -y php5-gd > php5-gd.txt
//if mysql is installed.. then also install the php5-mysql extension
if {(exists file "installedApps.txt" whose (exists lines whose (it starts with "mysql-server") of it) of parent folder of client) AND NOT (exists file "installedApps.txt" whose (exists lines whose (it starts with "php5-mysql") of it) of parent folder of client)}
delete "php5-mysql.txt"
appendfile apt-get install -q -y php5-mysql > php5-mysql.txt
endif
appendfile /etc/init.d/apache2 restart
delete "installer.sh"
move __appendfile "installer.sh"
wait chmod +x installer.sh
wait ./installer.sh
//add test document
delete __appendfile
appendfile
delete "/var/www/testphp.php"
move __appendfile "/var/www/testphp.php"
//wget localhost so we can have a validation step
wait wget http://localhost/ -o php.test
//lastly update the list of currently installed applications
delete __appendfile
appendfile #!/bin/sh
appendfile dpkg --get-selections > "{pathname of parent folder of client}/installedApps.txt"
delete "installedApps.sh"
delete "{pathname of parent folder of client}/installedApps.txt"
move __appendfile "installedApps.sh"
wait chmod +x installedApps.sh
wait ./installedApps.sh
Success Criteria

This action will be considered successful when the following relevance clause evaluates to false:

 
Used in 1 fixlet and 1 analsis   * Results in a true/false
Show indented relevance
if exists file "php.test" of client folder of current site then NOT exists lines whose (it as lowercase contains "200 ok") of file "php.test" of client folder of current site else true

Sharing

Social Media:
Share this page on Yammer

Comments

Log In or Register to leave comments!