Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Web Servers»Apache»How to Install PHP 5.4, Apache 2.2 and MySQL on Ubuntu 14.10, 14.04, 12.04 LTS

    How to Install PHP 5.4, Apache 2.2 and MySQL on Ubuntu 14.10, 14.04, 12.04 LTS

    RahulBy RahulMarch 15, 20142 Mins Read

    LAMP (Linux, Apache, MySQL and PHP ) Stack is the most popular environment in PHP website development and hosting. Linux is the operating system, Apache is the popular web server developed by Apache Foundation. MySQL is relational database management system used for storing data and PHP is an development language.

    This article will help you to Install Apache 2.2, MySQL and PHP 5.4 on Ubuntu 12.04 Systems. PHP 5.5 current stable version is available but some time we need to install older version. Ondřej Surý is maintaining the PPA for PHP 5.4 in launchpad. Use the following steps to setup complete web server enviroment using Ubuntu 12.04 LTS operating system.

    Step 1: Install PHP 5.4

    Use the following set of command to add PPA of PHP5.4 in our system and install it. Some times this setup causes some issues so we are also installing python-software-properties package in our system.

    $ sudo apt-get install python-software-properties
    $ sudo add-apt-repository ppa:ondrej/php5-oldstable
    $ sudo apt-get update
    $ sudo apt-get install -y php5
    

    Step 2: Install Aapche2

    After installing lets install Apache2 in our system. It also required to install libapache2-mod-php5 module to work PHP with Apache2.

    # apt-get install apache2 libapache2-mod-php5
    

    Step 3: Install MySQL

    Finally install mysql-server packages for MySQL database. Also install php5-mysql package to use MySQL support using php. Use following command to install it.

    # apt-get install mysql-server php5-mysql
    

    After installing MySQL execute following command for initial settings of MySQL server. This command will ask you to set root password and apply for many security changes.

    $ sudo mysql_secure_installation
    

    Step 4: Restart Apache2, MySQL Services

    After installing all services on your system, start all required services.

    # /etc/init.d/apache2 restart
    # /etc/init.d/mysql restart
    

    Step 5: Open Access in Firewall

    If you are using iptables, Use following commands to open port 80 for public access of webserver.

    # iptables -A INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT
    

    Congratulation’s! You have successfully configured web server on your ubuntu System. Read our next article Installing LAMP Stack on RHEL based systems

    Apache2 lamp MySQL mysql-server PHP5 PHP5.4
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Check for Vulnerabilities on Linux with Lynis
    Next Article How to Set Up LogMeIn (Hamachi) VPN on Ubuntu 16.04, CentOS/RHEL 7

    Related Posts

    Backup MySQL Databases to Amazon S3 (Shell Script)

    Updated:May 28, 20222 Mins Read

    How to Install MariaDB on Ubuntu 22.04

    Updated:May 28, 20222 Mins Read

    How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04

    Updated:June 19, 20223 Mins Read

    How To Install Linux, Nginx, MySQL, & PHP (LEMP Stack) on Ubuntu 22.04

    Updated:April 7, 20227 Mins Read

    How To Install MySQL Server on Ubuntu 22.04

    Updated:April 6, 20224 Mins Read

    How to Install Apache, MySQL, PHP (LAMP Stack) on Ubuntu 22.04

    Updated:June 28, 20225 Mins Read

    5 Comments

    1. Nitin kaushik on December 10, 2018 8:27 am

      Hello,
      ppa for php5.4 is not working.

      it’s giving the error given below –

      Cannot add PPA: ‘ppa:ondrej/php5-oldstable’.
      Please check that the PPA name or format is correct.

      Reply
    2. RavanH on September 9, 2018 7:56 pm

      ppa:ondrej/php5-oldstable does not exist anymore 🙁

      Reply
    3. Horace on September 15, 2015 8:07 pm

      Thank you ! This article help me a LOT !
      Nice Job !

      Reply
    4. coach handbags outlet locations on June 30, 2013 3:55 pm

      Caution is the parent of safety

      Reply
    5. formula ted original japan lingzhi on June 8, 2013 8:20 am

      Experience keeps a dear school, but fools learn in no other

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • How To Install Docker on Ubuntu 22.04
    • How to Install Bower on Ubuntu 22.04 & 20.04
    • How to run “npm start” through Docker
    • Filesystem Hierarchy Structure (FHS) in Linux
    • How to accept user input in Python
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.