SlideShare une entreprise Scribd logo
1  sur  6
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances (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
 

En vedette

Social Media Is Not Going To Save Your Brand
Social Media Is Not Going To Save Your BrandSocial Media Is Not Going To Save Your Brand
Social Media Is Not Going To Save Your BrandRichard Meyer
 
New Study Of Bhagavad Gita Dr Shriniwas J Kashalikar
New Study Of Bhagavad Gita  Dr  Shriniwas J  KashalikarNew Study Of Bhagavad Gita  Dr  Shriniwas J  Kashalikar
New Study Of Bhagavad Gita Dr Shriniwas J Kashalikarbanothkishan
 
Namasmaran B E S T S E L L E R O N S U P E R L I V I N G Dr
Namasmaran  B E S T S E L L E R  O N  S U P E R L I V I N G   DrNamasmaran  B E S T S E L L E R  O N  S U P E R L I V I N G   Dr
Namasmaran B E S T S E L L E R O N S U P E R L I V I N G Drbanothkishan
 
P R O P G A G A N D A D R
P R O P G A G A N D A  D RP R O P G A G A N D A  D R
P R O P G A G A N D A D Rbanothkishan
 

En vedette (6)

Social Media Is Not Going To Save Your Brand
Social Media Is Not Going To Save Your BrandSocial Media Is Not Going To Save Your Brand
Social Media Is Not Going To Save Your Brand
 
New Study Of Bhagavad Gita Dr Shriniwas J Kashalikar
New Study Of Bhagavad Gita  Dr  Shriniwas J  KashalikarNew Study Of Bhagavad Gita  Dr  Shriniwas J  Kashalikar
New Study Of Bhagavad Gita Dr Shriniwas J Kashalikar
 
Namasmaran B E S T S E L L E R O N S U P E R L I V I N G Dr
Namasmaran  B E S T S E L L E R  O N  S U P E R L I V I N G   DrNamasmaran  B E S T S E L L E R  O N  S U P E R L I V I N G   Dr
Namasmaran B E S T S E L L E R O N S U P E R L I V I N G Dr
 
P R O P G A G A N D A D R
P R O P G A G A N D A  D RP R O P G A G A N D A  D R
P R O P G A G A N D A D R
 
Micro Essay
Micro EssayMicro Essay
Micro Essay
 
CatConf2001
CatConf2001CatConf2001
CatConf2001
 

Similaire à 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
 

Plus 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
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008tutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheetstutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheetstutorialsruby
 

Plus 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
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 

Dernier

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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
 

Dernier (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 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...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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...
 

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