SlideShare uma empresa Scribd logo
1 de 6
Baixar para ler offline
CONTRIBUTED DOCUMENTATION
                         This document is NOT supported by Computing Services.
                     DO NOT contact the Help Center with questions on this document.



                                 Packaging PHP on Andrew Linux

Stephen Hathorne
Unix Systems Administrator
Infrastructure, Systems, Applications and Middleware
Carnegie Mellon
slh+@cmu.edu

This document is a tutorial on how to install PHP4 on an Andrew Linux System.

Assumptions

This document assumes that you have base familiarity with UNIX Systems
Administration, that you have administrative privileges, (a root instance), on the
system that need to be modified, and that you have passing familiarity with the
Andrew Package System.

Conventions


$> Represents a system prompt do not type this.
Items listed after the $> prompt are to be typed:

Example:

$> ls

This example indicates for the reader to type the ls command after the $>
prompt.

Items listed with borders and gray shaded represent file examples:


%define doesreallycoolstuff



Items listed in plain Arial Text 12 point font are explanatory in nature, and will
comprise most of the document.
Italicized items represent filenames or special instructions

Bold elements generally represent section headings or important topics
Step by Step Installation

         1. Modify /etc/package.proto to install necessary files
         2. Run /etc/mpp-package to update the system
         3. Modify httpd.conf so that apache understands what to do with a .php
            file.
         4. Create a sample php file and browse to it using a web browsers


I. Modify /etc/package.proto

/etc/package.proto is a file that is used by the Andrew Package System to
update, modify and place files on an Andrew System. In order to have package
load the Apache Web Server on an Andrew System we need to add the package
define1

%define doespachephp4
%define hashttpd.conf

to /etc/package.proto

The %doespache line that appears in the example should also be in
/etc/package.proto. This will load apache, and the php modules on the local disk.

Sample package.proto file:

%define doesapache
%define hashttpd.conf
%define doesapachephp4
%define usesdepot
%define localdepotdir
%define contribdepotdir
%define autolinuxspec
%include /afs/andrew.cmu.edu/wsadmin/public/src/public.proto




Step I is now complete.

II. Run /etc/mpp-package
This will invoke the Andrew Package system to copy, move, and reorient files on
the local disk. Based on your /etc/package.proto file. Using the one above will
cause package to load the Apache Web Server, and the PHP4 module.

1
    See Appendix A: Additional Resources for more information on Package
$>/etc/mpp-package

Step II is now complete

III. Modify /etc/httpd.conf

The file /usr/www/conf/httpd.conf controls aspects of the Apache Web Server2, in
our case we wish to be sure that the Web Server understands how to handle files
with a .php extension, as well as to add and load the php4 module. The
elements that have to be added to the file include:

AddModule mod_php4.c
LoadModule php4_module libexec/libphp4.so
AddType application/x-httpd-php .php
DirectoryIndex index.html index.php
php_flag asp_tags on

We will discuss each of these statements in the order that we will need to put
them in the file. At the end of this section we will see an complete example
httpd.conf..

AddModule mod_php4.c

This statement indicates to the Apache Web Server that we wish to add the
mod_php4.c module to our web server instance. In the httpd.conf file there is a
section that has a number of these lines. I usually put a new AddModule
statement on the last line of the AddModule section.

LoadModule php4_module libexec/libphp4.so

This statement tells Apache that the php4_module is invoked by using the file in
the libexec directory. This file is called libphp4.so, the full path based on our
model is: /usr/www/libexec/libphp4.so. Just as in the last line of the AddModule
section, I put a new LoadModule line at the end of the current LoadModule
section.

AddType application/x-httpd-php .php

This AddType line is an indication to the Apache Web Server that files ending
with a .php extension should be run using the php module that we have
previously loaded. Once again I place this declaration at the end of any current
AddType statements within the file.




2
    See Appendix A: Additional Resources for more information on Apache Configuration
DirectoryIndex index.html index.php

The DirectoryIndex statement is a simple directive to Apache that tells it that both
index.html, and index.php files may be present, an important note here. If both
files exist the first one in the ilst (in this case index.html will be invoked)

php_flag asp_tags on [optional]

This directive enables the developer to use the asp format tags for php scripts to
escape html, and separate html content from php programming

<?php echo “hello world”; ?> # php type tag

<% echo “hello world”; %> # asp type tag


IV. Create a simple .php file

At this point the Apache Web Server should be in place with the PHP4 module,
let’s create a simple php file in /usr/www/tree directory (the default
DocumentRoot Directory for Andrew Linux). This will allow us to test the Apache
php Installation.

Sample test.php
<html>
<head>
<title>This is a sample php file</title>
</head>
<body>
<?php
echo “<center><h1>Hello World of PHP</h1></center>”;
phpinfo();
?>
</body>
</html>


This simple php script puts a a bold and centered “Hello World of PHP on your
screen followed by the output of the phpinfo() subroutine. This subroutine
displays information about the php installation.
You reach this by typing:

http://yourmachinename.andrew.cmu.edu/test.php

in a browser window. Your results should look similar to the following:




The above image does not contain all of the information about the php
installation, you are likely to have to scroll quite a bit to get all of the information
depending on the size of your php installation and the number of database
engines and options configured.

Once you have seen the page above or your version from your machine, php
installed on your system.
Appendix A—Additional Resources

Additional information on package can be found at:

http://www.cmu.edu/computing/documentation/andrw_package/package.html

Additional information and documentation on Apache can be found at:
http://acs-wiki.andrew.cmu.edu/twiki/bin/view/Andrewenv/SoftwareHowTos
http://www.apache.org
http://www.php.net

Mais conteúdo relacionado

Mais procurados (17)

Apache Web Server Setup 2
Apache Web Server Setup 2Apache Web Server Setup 2
Apache Web Server Setup 2
 
File upload php
File upload phpFile upload php
File upload php
 
php
phpphp
php
 
Linux Webserver Installation Command and GUI.ppt
Linux Webserver Installation Command and GUI.pptLinux Webserver Installation Command and GUI.ppt
Linux Webserver Installation Command and GUI.ppt
 
Php1
Php1Php1
Php1
 
MySQL Presentation
MySQL PresentationMySQL Presentation
MySQL Presentation
 
Php
PhpPhp
Php
 
Php Ppt
Php PptPhp Ppt
Php Ppt
 
PHP-MySQL Database Connectivity Using XAMPP Server
PHP-MySQL Database Connectivity Using XAMPP ServerPHP-MySQL Database Connectivity Using XAMPP Server
PHP-MySQL Database Connectivity Using XAMPP Server
 
Unit 1
Unit 1Unit 1
Unit 1
 
Php File Operations
Php File OperationsPhp File Operations
Php File Operations
 
PHP Tutorials
PHP TutorialsPHP Tutorials
PHP Tutorials
 
Apache Web Server Setup 3
Apache Web Server Setup 3Apache Web Server Setup 3
Apache Web Server Setup 3
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
PHPExcel and OPENXML4J
PHPExcel and OPENXML4JPHPExcel and OPENXML4J
PHPExcel and OPENXML4J
 
Files in php
Files in phpFiles in php
Files in php
 
Apache
ApacheApache
Apache
 

Destaque

symfony_from_scratch
symfony_from_scratchsymfony_from_scratch
symfony_from_scratchtutorialsruby
 
ruby_vs_perl_and_python
ruby_vs_perl_and_pythonruby_vs_perl_and_python
ruby_vs_perl_and_pythontutorialsruby
 
Content Outside of CONTENTdm: Part 1: Exhibit Creation Tool using &lt;b>...&l...
Content Outside of CONTENTdm: Part 1: Exhibit Creation Tool using &lt;b>...&l...Content Outside of CONTENTdm: Part 1: Exhibit Creation Tool using &lt;b>...&l...
Content Outside of CONTENTdm: Part 1: Exhibit Creation Tool using &lt;b>...&l...tutorialsruby
 
CERT - EXXONMOBIL - RECORD MANAGEMENT - PART 11
CERT - EXXONMOBIL - RECORD MANAGEMENT - PART 11CERT - EXXONMOBIL - RECORD MANAGEMENT - PART 11
CERT - EXXONMOBIL - RECORD MANAGEMENT - PART 11Maria Raju
 
Extinción de las obligaciones danneriz y diaz v v-17.944.089
Extinción de las obligaciones danneriz y diaz v v-17.944.089Extinción de las obligaciones danneriz y diaz v v-17.944.089
Extinción de las obligaciones danneriz y diaz v v-17.944.089yenny mar g
 
CreatingHairwithMayanHair_CertificateOfCompletion
CreatingHairwithMayanHair_CertificateOfCompletionCreatingHairwithMayanHair_CertificateOfCompletion
CreatingHairwithMayanHair_CertificateOfCompletionVeronica Chiaravalli
 
Tutorial%20fivestar%20cck%20views
Tutorial%20fivestar%20cck%20viewsTutorial%20fivestar%20cck%20views
Tutorial%20fivestar%20cck%20viewstutorialsruby
 
cs3157-summer06-lab1
cs3157-summer06-lab1cs3157-summer06-lab1
cs3157-summer06-lab1tutorialsruby
 
photoshop_workshop_01
photoshop_workshop_01photoshop_workshop_01
photoshop_workshop_01tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008tutorialsruby
 

Destaque (20)

BPMS1
BPMS1BPMS1
BPMS1
 
symfony_from_scratch
symfony_from_scratchsymfony_from_scratch
symfony_from_scratch
 
ruby_vs_perl_and_python
ruby_vs_perl_and_pythonruby_vs_perl_and_python
ruby_vs_perl_and_python
 
e6
e6e6
e6
 
ruby-cocoa
ruby-cocoaruby-cocoa
ruby-cocoa
 
PCCNews0609
PCCNews0609PCCNews0609
PCCNews0609
 
INFS730
INFS730INFS730
INFS730
 
Content Outside of CONTENTdm: Part 1: Exhibit Creation Tool using &lt;b>...&l...
Content Outside of CONTENTdm: Part 1: Exhibit Creation Tool using &lt;b>...&l...Content Outside of CONTENTdm: Part 1: Exhibit Creation Tool using &lt;b>...&l...
Content Outside of CONTENTdm: Part 1: Exhibit Creation Tool using &lt;b>...&l...
 
CERT - EXXONMOBIL - RECORD MANAGEMENT - PART 11
CERT - EXXONMOBIL - RECORD MANAGEMENT - PART 11CERT - EXXONMOBIL - RECORD MANAGEMENT - PART 11
CERT - EXXONMOBIL - RECORD MANAGEMENT - PART 11
 
Extinción de las obligaciones danneriz y diaz v v-17.944.089
Extinción de las obligaciones danneriz y diaz v v-17.944.089Extinción de las obligaciones danneriz y diaz v v-17.944.089
Extinción de las obligaciones danneriz y diaz v v-17.944.089
 
User_Manual
User_ManualUser_Manual
User_Manual
 
CreatingHairwithMayanHair_CertificateOfCompletion
CreatingHairwithMayanHair_CertificateOfCompletionCreatingHairwithMayanHair_CertificateOfCompletion
CreatingHairwithMayanHair_CertificateOfCompletion
 
Tutorial%20fivestar%20cck%20views
Tutorial%20fivestar%20cck%20viewsTutorial%20fivestar%20cck%20views
Tutorial%20fivestar%20cck%20views
 
TS-5358
TS-5358TS-5358
TS-5358
 
cs3157-summer06-lab1
cs3157-summer06-lab1cs3157-summer06-lab1
cs3157-summer06-lab1
 
photoshop_workshop_01
photoshop_workshop_01photoshop_workshop_01
photoshop_workshop_01
 
CL2009_ANNIS_pre
CL2009_ANNIS_preCL2009_ANNIS_pre
CL2009_ANNIS_pre
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
Rf matematicas i
Rf matematicas iRf matematicas i
Rf matematicas i
 
transcripts aman
transcripts amantranscripts aman
transcripts aman
 

Semelhante a php (20)

John's Top PECL Picks
John's Top PECL PicksJohn's Top PECL Picks
John's Top PECL Picks
 
Php advance
Php advancePhp advance
Php advance
 
lecture 9.pptx
lecture 9.pptxlecture 9.pptx
lecture 9.pptx
 
Php1(2)
Php1(2)Php1(2)
Php1(2)
 
Php 1
Php 1Php 1
Php 1
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
Php ppt
Php pptPhp ppt
Php ppt
 
Getting started-with-zend-framework
Getting started-with-zend-frameworkGetting started-with-zend-framework
Getting started-with-zend-framework
 
Phalcon 2 - PHP Brazil Conference
Phalcon 2 - PHP Brazil ConferencePhalcon 2 - PHP Brazil Conference
Phalcon 2 - PHP Brazil Conference
 
Php1
Php1Php1
Php1
 
Php1
Php1Php1
Php1
 
Php1
Php1Php1
Php1
 
Winter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHPWinter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHP
 
Winter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHPWinter%200405%20-%20Beginning%20PHP
Winter%200405%20-%20Beginning%20PHP
 
Basics PHP
Basics PHPBasics PHP
Basics PHP
 
Flyr PHP micro-framework
Flyr PHP micro-frameworkFlyr PHP micro-framework
Flyr PHP micro-framework
 
Getting started-with-zend-framework
Getting started-with-zend-frameworkGetting started-with-zend-framework
Getting started-with-zend-framework
 
1 Introduction to PHP Overview This lab walks y.docx
1  Introduction to PHP Overview This lab walks y.docx1  Introduction to PHP Overview This lab walks y.docx
1 Introduction to PHP Overview This lab walks y.docx
 
Php
PhpPhp
Php
 

Mais de tutorialsruby

&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>tutorialsruby
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>tutorialsruby
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0tutorialsruby
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269tutorialsruby
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008tutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheetstutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheetstutorialsruby
 
Winter%200405%20-%20Advanced%20Javascript
Winter%200405%20-%20Advanced%20JavascriptWinter%200405%20-%20Advanced%20Javascript
Winter%200405%20-%20Advanced%20Javascripttutorialsruby
 

Mais de tutorialsruby (20)

&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
 
CSS
CSSCSS
CSS
 
CSS
CSSCSS
CSS
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
Winter%200405%20-%20Advanced%20Javascript
Winter%200405%20-%20Advanced%20JavascriptWinter%200405%20-%20Advanced%20Javascript
Winter%200405%20-%20Advanced%20Javascript
 

Último

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 

Último (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

php

  • 1. CONTRIBUTED DOCUMENTATION This document is NOT supported by Computing Services. DO NOT contact the Help Center with questions on this document. Packaging PHP on Andrew Linux Stephen Hathorne Unix Systems Administrator Infrastructure, Systems, Applications and Middleware Carnegie Mellon slh+@cmu.edu This document is a tutorial on how to install PHP4 on an Andrew Linux System. Assumptions This document assumes that you have base familiarity with UNIX Systems Administration, that you have administrative privileges, (a root instance), on the system that need to be modified, and that you have passing familiarity with the Andrew Package System. Conventions $> Represents a system prompt do not type this. Items listed after the $> prompt are to be typed: Example: $> ls This example indicates for the reader to type the ls command after the $> prompt. Items listed with borders and gray shaded represent file examples: %define doesreallycoolstuff Items listed in plain Arial Text 12 point font are explanatory in nature, and will comprise most of the document. Italicized items represent filenames or special instructions Bold elements generally represent section headings or important topics
  • 2. Step by Step Installation 1. Modify /etc/package.proto to install necessary files 2. Run /etc/mpp-package to update the system 3. Modify httpd.conf so that apache understands what to do with a .php file. 4. Create a sample php file and browse to it using a web browsers I. Modify /etc/package.proto /etc/package.proto is a file that is used by the Andrew Package System to update, modify and place files on an Andrew System. In order to have package load the Apache Web Server on an Andrew System we need to add the package define1 %define doespachephp4 %define hashttpd.conf to /etc/package.proto The %doespache line that appears in the example should also be in /etc/package.proto. This will load apache, and the php modules on the local disk. Sample package.proto file: %define doesapache %define hashttpd.conf %define doesapachephp4 %define usesdepot %define localdepotdir %define contribdepotdir %define autolinuxspec %include /afs/andrew.cmu.edu/wsadmin/public/src/public.proto Step I is now complete. II. Run /etc/mpp-package This will invoke the Andrew Package system to copy, move, and reorient files on the local disk. Based on your /etc/package.proto file. Using the one above will cause package to load the Apache Web Server, and the PHP4 module. 1 See Appendix A: Additional Resources for more information on Package
  • 3. $>/etc/mpp-package Step II is now complete III. Modify /etc/httpd.conf The file /usr/www/conf/httpd.conf controls aspects of the Apache Web Server2, in our case we wish to be sure that the Web Server understands how to handle files with a .php extension, as well as to add and load the php4 module. The elements that have to be added to the file include: AddModule mod_php4.c LoadModule php4_module libexec/libphp4.so AddType application/x-httpd-php .php DirectoryIndex index.html index.php php_flag asp_tags on We will discuss each of these statements in the order that we will need to put them in the file. At the end of this section we will see an complete example httpd.conf.. AddModule mod_php4.c This statement indicates to the Apache Web Server that we wish to add the mod_php4.c module to our web server instance. In the httpd.conf file there is a section that has a number of these lines. I usually put a new AddModule statement on the last line of the AddModule section. LoadModule php4_module libexec/libphp4.so This statement tells Apache that the php4_module is invoked by using the file in the libexec directory. This file is called libphp4.so, the full path based on our model is: /usr/www/libexec/libphp4.so. Just as in the last line of the AddModule section, I put a new LoadModule line at the end of the current LoadModule section. AddType application/x-httpd-php .php This AddType line is an indication to the Apache Web Server that files ending with a .php extension should be run using the php module that we have previously loaded. Once again I place this declaration at the end of any current AddType statements within the file. 2 See Appendix A: Additional Resources for more information on Apache Configuration
  • 4. DirectoryIndex index.html index.php The DirectoryIndex statement is a simple directive to Apache that tells it that both index.html, and index.php files may be present, an important note here. If both files exist the first one in the ilst (in this case index.html will be invoked) php_flag asp_tags on [optional] This directive enables the developer to use the asp format tags for php scripts to escape html, and separate html content from php programming <?php echo “hello world”; ?> # php type tag <% echo “hello world”; %> # asp type tag IV. Create a simple .php file At this point the Apache Web Server should be in place with the PHP4 module, let’s create a simple php file in /usr/www/tree directory (the default DocumentRoot Directory for Andrew Linux). This will allow us to test the Apache php Installation. Sample test.php <html> <head> <title>This is a sample php file</title> </head> <body> <?php echo “<center><h1>Hello World of PHP</h1></center>”; phpinfo(); ?> </body> </html> This simple php script puts a a bold and centered “Hello World of PHP on your screen followed by the output of the phpinfo() subroutine. This subroutine displays information about the php installation.
  • 5. You reach this by typing: http://yourmachinename.andrew.cmu.edu/test.php in a browser window. Your results should look similar to the following: The above image does not contain all of the information about the php installation, you are likely to have to scroll quite a bit to get all of the information depending on the size of your php installation and the number of database engines and options configured. Once you have seen the page above or your version from your machine, php installed on your system.
  • 6. Appendix A—Additional Resources Additional information on package can be found at: http://www.cmu.edu/computing/documentation/andrw_package/package.html Additional information and documentation on Apache can be found at: http://acs-wiki.andrew.cmu.edu/twiki/bin/view/Andrewenv/SoftwareHowTos http://www.apache.org http://www.php.net