SlideShare una empresa de Scribd logo
1 de 6
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

La actualidad más candente (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
 

Destacado

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
 

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

Similar 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
 

Más 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
 

Más 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

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 

Último (20)

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 

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