SlideShare une entreprise Scribd logo
1  sur  5
Télécharger pour lire hors ligne
How to install PHP on Linux | laffers.net                                                                    http://laffers.net/howtos/howto-install-php




            Laffers.net

            Home › Howtos

            How To Install PHP On Linux
            Sat, 04/07/2007 - 03:12 — Richard Laffers

            This tutorial explains the installation of PHP 5, bundled with Apache and MySQL server on a Linux machine. The tutorial
            was written primarily for SuSE 9.2, 9.3, 10.0 & 10.1, but most of the steps ought to be valid for all Linux-like operating
            systems.

            We will set up PHP as a shared module, being loaded into Apache2 dynamically during the server startup. These
            instructions are known to work for PHP versions: 5.0.4 through 5.2.1.

            Prerequisites
            At this point Apache web server must be installed. If you want MySQL support in PHP, MySQL server also must have been
            installed prior to the next steps.

            Download Source
            Get the source from http://www.php.net/downloads.php          . At the time of writing this tutorial the best available version
            was 5.2.1 ( php-5.2.1.tar.gz ).


            Unpack, Configure, Compile
            Go to the directory whith the downloaded file and enter:

                # tar -xzf php-5.2.1.tar.gz
                # cd php-5.2.1
                #         ./configure            --prefix=/usr/local/php              --with-apxs2=/usr/local/apache2/bin/apxs
                --with-mysql=/usr/local/mysql


            The configuration options ought to be self-explaining; --prefix specifies the location where PHP is to be installed,
            --with-apxs2 with correct path pointing to bin/apxs in the Apache installation directory is mandatory for the installator
            to work. Since PHP 5, you need to explicitly bundle PHP with MySQL by --with-mysql directive (make sure you specified
            path to where MySQL is installed on your system).
            There are many other options which turn on additional features. For all available configuration options and their default
            values type ./configure --help.


            Tip: If you are performing an upgrade, you may want to copy config.nice from the old PHP installation directory (if
            available) to where you unpacked the new PHP tarball file. Run ./config.nice instead of ./configure. This way all the
            previous configure options will be applied to the new installation effortlessly.

            Once you entered ./configure with all the options you need, compile and install the software:


                # make
                # make install


            Edit Httpd.conf
            All necessary changes to httpd.conf (Apache configuration file) should have already been made automatically during the
            installation, so usually you need not do anything. Nevertheless, check that following lines were added to the httpd.conf
            file:

                LoadModule php5_module modules/libphp5.so




1 από 5                                                                                                                               13/6/2007 4:57 μμ
How to install PHP on Linux | laffers.net                                                                        http://laffers.net/howtos/howto-install-php


                AddType application/x-httpd-php .php


            If not, add them manually.

            Create Php.ini File
            Importanly, you have to create a php.ini configuration file. Choose one of the pre-made files (preferably
            php.ini-recommended) residing inside the php-5.2.1/ directory (it's the folder to which the downloaded archive was
            extracted). Copy the file to the lib/ directory in the PHP installation directory.


                # cp php-5.2.1/php.ini-recommended /usr/local/php/lib/php.ini


            If you need to, edit the php.ini file:


                # vi /usr/local/php/lib/php.ini


            However, the default settings should work for everyone in most cases.

            Restart Apache Server
            After everything is set up, restart Apache:


                # /usr/local/bin/apachectl restart


            Further Reading
            PHP Manual

            Do you have an idea how to make these instructions better? Did you run into any problems or have any tips? You are
            welcome to share your experience in the comments.


             ‹ How to install Apache on Linux                                up

            Printer-friendly version         Add new comment                                            howto    linux   php    suse    tutorial



            Comments

            » Posted on Tue, 04/04/2006 - 13:37 — Virgil

            Thanks for the information ... Help me very much.


            reply



            » Posted on Fri, 05/05/2006 - 07:36 — Helen McCarthy

            This is great!! Thanks, a lot.


            Helen


            reply



            » Posted on Tue, 06/06/2006 - 00:49 — exkludge

            Bravo! This is a very good and valuable source of information... thank you!


            reply



            » Posted on Tue, 06/06/2006 - 03:36 — Hans

            I hv followed every steps from this how-to. I got mysql, apache and php installed. BUT, why my php script dosnt work? Even phpinfo()




2 από 5                                                                                                                                   13/6/2007 4:57 μμ
How to install PHP on Linux | laffers.net                                                                             http://laffers.net/howtos/howto-install-php


            shows nothing. Only html can be shown. :(


            reply



                 » Posted on Tue, 06/06/2006 - 07:59 — Richard Laffers

                 I would first make sure that .php extension is registered in your httpd.conf - you must have


                     LoadModule php5_module modules/libphp5.so
                     AddType application/x-httpd-php .php




                 somewhere in it. Also, check apache error log to see if any errors/warnings are generated during starting of the server.


                 reply



            » Posted on Tue, 06/06/2006 - 06:07 — PowerEdge

            This is very nice tut, but doesn't really help when you just want to upgrade your php 4.4 to 5.x ... as apache2 is by default in SUSE
            installed under /etc/apache2 and there is neither bin nor apxs folder ... same is for MySQL. Could you please address this issue for
            default SUSE installation paths for both Apache2 and MySQL servers .. thanks :)


            reply



                 » Posted 1 month ago — Richard Laffers

                 I'm afraid you will have to uninstall both PHP and Apache first (using YaST) to start from scratch. Then follow my MySQL, Apache
                 and PHP tutorials.


                 reply



            » Posted 6 days ago — Y2Beck

            A+ article for simple startups. I was having trouble all day installing the "Big 3" until I came across this article. Good documentation as
            well. PLEASE let us know if you are going to work on an advanced article focusing on optimalization and security for small, medium and
            big installs!!!


            reply



                 » Posted on Tue, 06/06/2006 - 21:52 — Richard Laffers

                 Thanks. I haven't much experience with server optimalization, however, I would recommend studying this:


                 http://httpd.apache.org/docs/2.2/misc/security_tips.html

                 http://httpd.apache.org/docs/2.2/misc/perf-tuning.html


                 Also, it is possible to specify 'Resource limits' in php.ini. MySQL distribution contains pre-made configuration files for
                 small/medium/large/huge servers. Hope this helps.


                 reply



            » Posted on Tue, 06/06/2006 - 08:05 — Petrov

            You, my friend, are a legend :) Thank you so much for helping make this task MUCH easier! This is the first time I've compiled from
            source rather than using RPM's and it actually worked! Cheers!


            reply




3 από 5                                                                                                                                          13/6/2007 4:57 μμ
How to install PHP on Linux | laffers.net                                                                          http://laffers.net/howtos/howto-install-php



            » Posted 11 months ago — Valter

            I'm totally new with Linux, but this is what I've got from php.net   :


            "MySQL is not enabled by default, nor is the MySQL library bundled with PHP. Read this FAQ for details on why. Use the
            --with-mysql[=DIR] configure option to include MySQL support. You can download headers and libraries fromMySQL."


            reply



            » Posted 9 months ago — DxJaK

            No problems with the installation , but when I want to open say http://localhost/hello.php   firefox & konqueror want to save the file.
            Have you got any suggestions??


            reply



                » Posted 9 months ago — Richard Laffers

                Make sure that the following line has been added in httpd.conf: AddType application/x-httpd-php .php


                reply



            » Posted 7 months ago — John

            Great instructions for all three apps (Apache, PHP, & MySql). All were successfully loaded up and running. I'm able to call PHP scripts
            fm my HTML files. However, passing variables fm HTML to PHP is unsuccessful. Any thoughts?


            reply



                » Posted 7 months ago — Anonymous

                The variables are passed to $_POST and $_GET superglobal arrays. Look for them in those.


                reply



            » Posted 6 months ago — Jason

            Thanks for the great tutorial. I've leased dedicated servers before, but recently set up my own suse home server, and woah, its a
            whole new ball game when you have to set everything up! Thanks for the concise instructions. Im relatively new to linux
            administration, but I found this guide very easy to follow. Have you thought about putting up a paypal donation button? :)


            reply



                » Posted 6 months ago — Richard Laffers

                I'm glad you find this guide useful. As for the donations, the real gratitude should be directed towards the MySQL, Apache and PHP
                developers. :-)


                reply



            » Posted 6 months ago — SteveMac

            For confirmation, I have just installed the three key apps onto SuSE 10.0. The versions used were: mySQL: 5.0.27 Apache: 2.2.3 PHP:
            5.2.0 Which proves that the tutorials still work with some later versions. (The only thing I needed to add was the curses/termcap for
            mySQL compilation, and the libxml2-devel for PHP compilation. This was done using the yast2 software management utility and the
            distribution CD. Thanks for all the help.




4 από 5                                                                                                                                      13/6/2007 4:57 μμ
How to install PHP on Linux | laffers.net                                                                        http://laffers.net/howtos/howto-install-php


            Steve


            reply



            » Posted 5 months ago — ieee488

            Any articles on how to add phpMyAdmin to the mix? MySQL, Apache2, and PHP5 are working, but I keep getting #2002 - The server is
            not responding (or the local MySQL server's socket is not correctly configured) which appears to be a common problem.


            reply


                                                   © 2005-2007 Richard Laffers. All rights reserved.




5 από 5                                                                                                                                  13/6/2007 4:57 μμ

Contenu connexe

Tendances

How tos nagios - centos wiki
How tos nagios - centos wikiHow tos nagios - centos wiki
How tos nagios - centos wikishahab071
 
Composer tools and frameworks for drupal.ppt
Composer tools and frameworks for drupal.pptComposer tools and frameworks for drupal.ppt
Composer tools and frameworks for drupal.pptPromet Source
 
The Gory Details of Debian packages
The Gory Details of Debian packagesThe Gory Details of Debian packages
The Gory Details of Debian packagesJeremiah Foster
 
APACHE
APACHEAPACHE
APACHEARJUN
 
DevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of ChefDevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of ChefAntons Kranga
 
Añadiendo Jenkins al entorno para Integración continua
Añadiendo Jenkins al entorno para Integración continuaAñadiendo Jenkins al entorno para Integración continua
Añadiendo Jenkins al entorno para Integración continuaCésar Martín Ortiz Pintado
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.catPablo Godel
 
Using Composer with Drupal and Drush
Using Composer with Drupal and DrushUsing Composer with Drupal and Drush
Using Composer with Drupal and DrushPantheon
 
Inithub.org presentation
Inithub.org presentationInithub.org presentation
Inithub.org presentationAaron Welch
 
Configuring Django projects for multiple environments
Configuring Django projects for multiple environmentsConfiguring Django projects for multiple environments
Configuring Django projects for multiple environmentsApptension
 
Martin Aspeli Extending And Customising Plone 3
Martin Aspeli   Extending And Customising Plone 3Martin Aspeli   Extending And Customising Plone 3
Martin Aspeli Extending And Customising Plone 3Vincenzo Barone
 
Nginx 0.8.x + php 5.2.13 (fast cgi) setup web server
Nginx 0.8.x + php 5.2.13 (fast cgi) setup web serverNginx 0.8.x + php 5.2.13 (fast cgi) setup web server
Nginx 0.8.x + php 5.2.13 (fast cgi) setup web serverwruben
 
Website releases made easy with the PEAR installer, OSCON 2009
Website releases made easy with the PEAR installer, OSCON 2009Website releases made easy with the PEAR installer, OSCON 2009
Website releases made easy with the PEAR installer, OSCON 2009Helgi Þormar Þorbjörnsson
 
Practical introduction to dev ops with chef
Practical introduction to dev ops with chefPractical introduction to dev ops with chef
Practical introduction to dev ops with chefLeanDog
 
Php through the eyes of a hoster phpbnl11
Php through the eyes of a hoster phpbnl11Php through the eyes of a hoster phpbnl11
Php through the eyes of a hoster phpbnl11Combell NV
 
A Node.JS bag of goodies for analyzing Web Traffic
A Node.JS bag of goodies for analyzing Web TrafficA Node.JS bag of goodies for analyzing Web Traffic
A Node.JS bag of goodies for analyzing Web TrafficPhilip Tellis
 
Running PHP on Windows Technical Overview
Running PHP on Windows Technical OverviewRunning PHP on Windows Technical Overview
Running PHP on Windows Technical OverviewWes Yanaga
 
Virtual Bolt Workshop - 6 May
Virtual Bolt Workshop - 6 MayVirtual Bolt Workshop - 6 May
Virtual Bolt Workshop - 6 MayPuppet
 

Tendances (20)

How tos nagios - centos wiki
How tos nagios - centos wikiHow tos nagios - centos wiki
How tos nagios - centos wiki
 
Composer tools and frameworks for drupal.ppt
Composer tools and frameworks for drupal.pptComposer tools and frameworks for drupal.ppt
Composer tools and frameworks for drupal.ppt
 
Ansible project-deploy
Ansible project-deployAnsible project-deploy
Ansible project-deploy
 
The Gory Details of Debian packages
The Gory Details of Debian packagesThe Gory Details of Debian packages
The Gory Details of Debian packages
 
APACHE
APACHEAPACHE
APACHE
 
DevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of ChefDevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of Chef
 
Añadiendo Jenkins al entorno para Integración continua
Añadiendo Jenkins al entorno para Integración continuaAñadiendo Jenkins al entorno para Integración continua
Añadiendo Jenkins al entorno para Integración continua
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Presentation
PresentationPresentation
Presentation
 
Using Composer with Drupal and Drush
Using Composer with Drupal and DrushUsing Composer with Drupal and Drush
Using Composer with Drupal and Drush
 
Inithub.org presentation
Inithub.org presentationInithub.org presentation
Inithub.org presentation
 
Configuring Django projects for multiple environments
Configuring Django projects for multiple environmentsConfiguring Django projects for multiple environments
Configuring Django projects for multiple environments
 
Martin Aspeli Extending And Customising Plone 3
Martin Aspeli   Extending And Customising Plone 3Martin Aspeli   Extending And Customising Plone 3
Martin Aspeli Extending And Customising Plone 3
 
Nginx 0.8.x + php 5.2.13 (fast cgi) setup web server
Nginx 0.8.x + php 5.2.13 (fast cgi) setup web serverNginx 0.8.x + php 5.2.13 (fast cgi) setup web server
Nginx 0.8.x + php 5.2.13 (fast cgi) setup web server
 
Website releases made easy with the PEAR installer, OSCON 2009
Website releases made easy with the PEAR installer, OSCON 2009Website releases made easy with the PEAR installer, OSCON 2009
Website releases made easy with the PEAR installer, OSCON 2009
 
Practical introduction to dev ops with chef
Practical introduction to dev ops with chefPractical introduction to dev ops with chef
Practical introduction to dev ops with chef
 
Php through the eyes of a hoster phpbnl11
Php through the eyes of a hoster phpbnl11Php through the eyes of a hoster phpbnl11
Php through the eyes of a hoster phpbnl11
 
A Node.JS bag of goodies for analyzing Web Traffic
A Node.JS bag of goodies for analyzing Web TrafficA Node.JS bag of goodies for analyzing Web Traffic
A Node.JS bag of goodies for analyzing Web Traffic
 
Running PHP on Windows Technical Overview
Running PHP on Windows Technical OverviewRunning PHP on Windows Technical Overview
Running PHP on Windows Technical Overview
 
Virtual Bolt Workshop - 6 May
Virtual Bolt Workshop - 6 MayVirtual Bolt Workshop - 6 May
Virtual Bolt Workshop - 6 May
 

En vedette

En vedette (6)

YouDrup_in_Drupal
YouDrup_in_DrupalYouDrup_in_Drupal
YouDrup_in_Drupal
 
Perl%20Tutorial.!Picking%20Up%20Perl
Perl%20Tutorial.!Picking%20Up%20PerlPerl%20Tutorial.!Picking%20Up%20Perl
Perl%20Tutorial.!Picking%20Up%20Perl
 
newperl5
newperl5newperl5
newperl5
 
d_vbp_print
d_vbp_printd_vbp_print
d_vbp_print
 
hw1a
hw1ahw1a
hw1a
 
TemplateTutorial
TemplateTutorialTemplateTutorial
TemplateTutorial
 

Similaire à How%20to%20install%20PHP%20on%20Linux%20_%20laffers

Updating_PHP_on_OS_X_Server
Updating_PHP_on_OS_X_ServerUpdating_PHP_on_OS_X_Server
Updating_PHP_on_OS_X_Servertutorialsruby
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />tutorialsruby
 
Updating_PHP_on_OS_X_Server
Updating_PHP_on_OS_X_ServerUpdating_PHP_on_OS_X_Server
Updating_PHP_on_OS_X_Servertutorialsruby
 
Php hypertext Preprocessor
Php hypertext PreprocessorPhp hypertext Preprocessor
Php hypertext PreprocessorMrsRLakshmiIT
 
Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Adding_GD2_to_PHP_on_OS_X_Server_10_5_LeopardAdding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopardtutorialsruby
 
Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Adding_GD2_to_PHP_on_OS_X_Server_10_5_LeopardAdding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopardtutorialsruby
 
Installation instruction of Testlink
Installation instruction of TestlinkInstallation instruction of Testlink
Installation instruction of Testlinkusha kannappan
 
2013 - Dustin whittle - Escalando PHP en la vida real
2013 - Dustin whittle - Escalando PHP en la vida real2013 - Dustin whittle - Escalando PHP en la vida real
2013 - Dustin whittle - Escalando PHP en la vida realPHP Conference Argentina
 
Create dynamic sites with PHP & MySQL
Create dynamic sites with PHP & MySQLCreate dynamic sites with PHP & MySQL
Create dynamic sites with PHP & MySQLkangaro10a
 
Wamp & LAMP - Installation and Configuration
Wamp & LAMP - Installation and ConfigurationWamp & LAMP - Installation and Configuration
Wamp & LAMP - Installation and ConfigurationChetan Soni
 
Php through the eyes of a hoster confoo
Php through the eyes of a hoster confooPhp through the eyes of a hoster confoo
Php through the eyes of a hoster confooCombell NV
 
Upstate CSCI 450 PHP Chapters 5, 12, 13
Upstate CSCI 450 PHP Chapters 5, 12, 13Upstate CSCI 450 PHP Chapters 5, 12, 13
Upstate CSCI 450 PHP Chapters 5, 12, 13DanWooster1
 

Similaire à How%20to%20install%20PHP%20on%20Linux%20_%20laffers (20)

Updating_PHP_on_OS_X_Server
Updating_PHP_on_OS_X_ServerUpdating_PHP_on_OS_X_Server
Updating_PHP_on_OS_X_Server
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
 
Updating_PHP_on_OS_X_Server
Updating_PHP_on_OS_X_ServerUpdating_PHP_on_OS_X_Server
Updating_PHP_on_OS_X_Server
 
Php hypertext Preprocessor
Php hypertext PreprocessorPhp hypertext Preprocessor
Php hypertext Preprocessor
 
Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Adding_GD2_to_PHP_on_OS_X_Server_10_5_LeopardAdding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
 
Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Adding_GD2_to_PHP_on_OS_X_Server_10_5_LeopardAdding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
 
Installation instruction of Testlink
Installation instruction of TestlinkInstallation instruction of Testlink
Installation instruction of Testlink
 
2013 - Dustin whittle - Escalando PHP en la vida real
2013 - Dustin whittle - Escalando PHP en la vida real2013 - Dustin whittle - Escalando PHP en la vida real
2013 - Dustin whittle - Escalando PHP en la vida real
 
Jones_Lamp_Tutorial
Jones_Lamp_TutorialJones_Lamp_Tutorial
Jones_Lamp_Tutorial
 
Create dynamic sites with PHP & MySQL
Create dynamic sites with PHP & MySQLCreate dynamic sites with PHP & MySQL
Create dynamic sites with PHP & MySQL
 
Sahu
SahuSahu
Sahu
 
Php mysql-tutorial-en
Php mysql-tutorial-enPhp mysql-tutorial-en
Php mysql-tutorial-en
 
Lumen
LumenLumen
Lumen
 
Wamp & LAMP - Installation and Configuration
Wamp & LAMP - Installation and ConfigurationWamp & LAMP - Installation and Configuration
Wamp & LAMP - Installation and Configuration
 
Php ppt
Php pptPhp ppt
Php ppt
 
Phalcon - Giant Killer
Phalcon - Giant KillerPhalcon - Giant Killer
Phalcon - Giant Killer
 
Apache ssl
Apache ssl Apache ssl
Apache ssl
 
Php through the eyes of a hoster confoo
Php through the eyes of a hoster confooPhp through the eyes of a hoster confoo
Php through the eyes of a hoster confoo
 
Upstate CSCI 450 PHP Chapters 5, 12, 13
Upstate CSCI 450 PHP Chapters 5, 12, 13Upstate CSCI 450 PHP Chapters 5, 12, 13
Upstate CSCI 450 PHP Chapters 5, 12, 13
 
Phalcon 2 - PHP Brazil Conference
Phalcon 2 - PHP Brazil ConferencePhalcon 2 - PHP Brazil Conference
Phalcon 2 - PHP Brazil Conference
 

Plus de tutorialsruby

<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />tutorialsruby
 
TopStyle Help & <b>Tutorial</b>
TopStyle Help & <b>Tutorial</b>TopStyle Help & <b>Tutorial</b>
TopStyle Help & <b>Tutorial</b>tutorialsruby
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>tutorialsruby
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />tutorialsruby
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<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)

<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
 
TopStyle Help & <b>Tutorial</b>
TopStyle Help & <b>Tutorial</b>TopStyle Help & <b>Tutorial</b>
TopStyle Help & <b>Tutorial</b>
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<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

UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
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
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
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
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 

Dernier (20)

UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
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
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
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
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 

How%20to%20install%20PHP%20on%20Linux%20_%20laffers

  • 1. How to install PHP on Linux | laffers.net http://laffers.net/howtos/howto-install-php Laffers.net Home › Howtos How To Install PHP On Linux Sat, 04/07/2007 - 03:12 — Richard Laffers This tutorial explains the installation of PHP 5, bundled with Apache and MySQL server on a Linux machine. The tutorial was written primarily for SuSE 9.2, 9.3, 10.0 & 10.1, but most of the steps ought to be valid for all Linux-like operating systems. We will set up PHP as a shared module, being loaded into Apache2 dynamically during the server startup. These instructions are known to work for PHP versions: 5.0.4 through 5.2.1. Prerequisites At this point Apache web server must be installed. If you want MySQL support in PHP, MySQL server also must have been installed prior to the next steps. Download Source Get the source from http://www.php.net/downloads.php . At the time of writing this tutorial the best available version was 5.2.1 ( php-5.2.1.tar.gz ). Unpack, Configure, Compile Go to the directory whith the downloaded file and enter: # tar -xzf php-5.2.1.tar.gz # cd php-5.2.1 # ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql The configuration options ought to be self-explaining; --prefix specifies the location where PHP is to be installed, --with-apxs2 with correct path pointing to bin/apxs in the Apache installation directory is mandatory for the installator to work. Since PHP 5, you need to explicitly bundle PHP with MySQL by --with-mysql directive (make sure you specified path to where MySQL is installed on your system). There are many other options which turn on additional features. For all available configuration options and their default values type ./configure --help. Tip: If you are performing an upgrade, you may want to copy config.nice from the old PHP installation directory (if available) to where you unpacked the new PHP tarball file. Run ./config.nice instead of ./configure. This way all the previous configure options will be applied to the new installation effortlessly. Once you entered ./configure with all the options you need, compile and install the software: # make # make install Edit Httpd.conf All necessary changes to httpd.conf (Apache configuration file) should have already been made automatically during the installation, so usually you need not do anything. Nevertheless, check that following lines were added to the httpd.conf file: LoadModule php5_module modules/libphp5.so 1 από 5 13/6/2007 4:57 μμ
  • 2. How to install PHP on Linux | laffers.net http://laffers.net/howtos/howto-install-php AddType application/x-httpd-php .php If not, add them manually. Create Php.ini File Importanly, you have to create a php.ini configuration file. Choose one of the pre-made files (preferably php.ini-recommended) residing inside the php-5.2.1/ directory (it's the folder to which the downloaded archive was extracted). Copy the file to the lib/ directory in the PHP installation directory. # cp php-5.2.1/php.ini-recommended /usr/local/php/lib/php.ini If you need to, edit the php.ini file: # vi /usr/local/php/lib/php.ini However, the default settings should work for everyone in most cases. Restart Apache Server After everything is set up, restart Apache: # /usr/local/bin/apachectl restart Further Reading PHP Manual Do you have an idea how to make these instructions better? Did you run into any problems or have any tips? You are welcome to share your experience in the comments. ‹ How to install Apache on Linux up Printer-friendly version Add new comment howto linux php suse tutorial Comments » Posted on Tue, 04/04/2006 - 13:37 — Virgil Thanks for the information ... Help me very much. reply » Posted on Fri, 05/05/2006 - 07:36 — Helen McCarthy This is great!! Thanks, a lot. Helen reply » Posted on Tue, 06/06/2006 - 00:49 — exkludge Bravo! This is a very good and valuable source of information... thank you! reply » Posted on Tue, 06/06/2006 - 03:36 — Hans I hv followed every steps from this how-to. I got mysql, apache and php installed. BUT, why my php script dosnt work? Even phpinfo() 2 από 5 13/6/2007 4:57 μμ
  • 3. How to install PHP on Linux | laffers.net http://laffers.net/howtos/howto-install-php shows nothing. Only html can be shown. :( reply » Posted on Tue, 06/06/2006 - 07:59 — Richard Laffers I would first make sure that .php extension is registered in your httpd.conf - you must have LoadModule php5_module modules/libphp5.so AddType application/x-httpd-php .php somewhere in it. Also, check apache error log to see if any errors/warnings are generated during starting of the server. reply » Posted on Tue, 06/06/2006 - 06:07 — PowerEdge This is very nice tut, but doesn't really help when you just want to upgrade your php 4.4 to 5.x ... as apache2 is by default in SUSE installed under /etc/apache2 and there is neither bin nor apxs folder ... same is for MySQL. Could you please address this issue for default SUSE installation paths for both Apache2 and MySQL servers .. thanks :) reply » Posted 1 month ago — Richard Laffers I'm afraid you will have to uninstall both PHP and Apache first (using YaST) to start from scratch. Then follow my MySQL, Apache and PHP tutorials. reply » Posted 6 days ago — Y2Beck A+ article for simple startups. I was having trouble all day installing the "Big 3" until I came across this article. Good documentation as well. PLEASE let us know if you are going to work on an advanced article focusing on optimalization and security for small, medium and big installs!!! reply » Posted on Tue, 06/06/2006 - 21:52 — Richard Laffers Thanks. I haven't much experience with server optimalization, however, I would recommend studying this: http://httpd.apache.org/docs/2.2/misc/security_tips.html http://httpd.apache.org/docs/2.2/misc/perf-tuning.html Also, it is possible to specify 'Resource limits' in php.ini. MySQL distribution contains pre-made configuration files for small/medium/large/huge servers. Hope this helps. reply » Posted on Tue, 06/06/2006 - 08:05 — Petrov You, my friend, are a legend :) Thank you so much for helping make this task MUCH easier! This is the first time I've compiled from source rather than using RPM's and it actually worked! Cheers! reply 3 από 5 13/6/2007 4:57 μμ
  • 4. How to install PHP on Linux | laffers.net http://laffers.net/howtos/howto-install-php » Posted 11 months ago — Valter I'm totally new with Linux, but this is what I've got from php.net : "MySQL is not enabled by default, nor is the MySQL library bundled with PHP. Read this FAQ for details on why. Use the --with-mysql[=DIR] configure option to include MySQL support. You can download headers and libraries fromMySQL." reply » Posted 9 months ago — DxJaK No problems with the installation , but when I want to open say http://localhost/hello.php firefox & konqueror want to save the file. Have you got any suggestions?? reply » Posted 9 months ago — Richard Laffers Make sure that the following line has been added in httpd.conf: AddType application/x-httpd-php .php reply » Posted 7 months ago — John Great instructions for all three apps (Apache, PHP, & MySql). All were successfully loaded up and running. I'm able to call PHP scripts fm my HTML files. However, passing variables fm HTML to PHP is unsuccessful. Any thoughts? reply » Posted 7 months ago — Anonymous The variables are passed to $_POST and $_GET superglobal arrays. Look for them in those. reply » Posted 6 months ago — Jason Thanks for the great tutorial. I've leased dedicated servers before, but recently set up my own suse home server, and woah, its a whole new ball game when you have to set everything up! Thanks for the concise instructions. Im relatively new to linux administration, but I found this guide very easy to follow. Have you thought about putting up a paypal donation button? :) reply » Posted 6 months ago — Richard Laffers I'm glad you find this guide useful. As for the donations, the real gratitude should be directed towards the MySQL, Apache and PHP developers. :-) reply » Posted 6 months ago — SteveMac For confirmation, I have just installed the three key apps onto SuSE 10.0. The versions used were: mySQL: 5.0.27 Apache: 2.2.3 PHP: 5.2.0 Which proves that the tutorials still work with some later versions. (The only thing I needed to add was the curses/termcap for mySQL compilation, and the libxml2-devel for PHP compilation. This was done using the yast2 software management utility and the distribution CD. Thanks for all the help. 4 από 5 13/6/2007 4:57 μμ
  • 5. How to install PHP on Linux | laffers.net http://laffers.net/howtos/howto-install-php Steve reply » Posted 5 months ago — ieee488 Any articles on how to add phpMyAdmin to the mix? MySQL, Apache2, and PHP5 are working, but I keep getting #2002 - The server is not responding (or the local MySQL server's socket is not correctly configured) which appears to be a common problem. reply © 2005-2007 Richard Laffers. All rights reserved. 5 από 5 13/6/2007 4:57 μμ