How to Set up Php on Apache 2.2.3 on CentOS 5.3
Method 1 of 2:
Httpd
- Connect to your VPS using SSH to get a command line (unless its being installed on your local machine). Your machine will need to be connected to the network to download packages. Packages can be installed using the 'yum' command.
- CentOS and Red Hat based distros call the Apache server 'httpd' rather than Apache. This can be confusing at times to new people, but it is the same application/server. You should search for Apache using the command 'yum search httpd' . This will probably show you a lot of results, however some of these things are modules or addons. The main one to look for looks like 'httpd.i386' or similar. Now you can install it with 'yum install httpd.i386'
- Remember that search for the PHP. PHP comes with many modules, this means a 'yum search php' will show a lot more items. The main one to install is php.i386 (like the httpd) unless you run a 64bit OS in which case you will see the difference in name in the search.
Method 2 of 2:
PHP
- Install the PHP, and any modules you need. Modules start with php- . ie common install line would be yum install php.i386 php-imap.i386 php-dbase.i386 php-xml.i386 php-pgsql.i386 php-mysql.i386 php-gd.i386 php-mcrypt.i386
- Restart the Apache server with 'service httpd restart'
- Put the following script anywhere under your document root (usually /var/www/html/) but make sure it has a .php extension (ie index.php):
- Open your web browser and browse to the uploaded file, and if it says Hello World, then PHP is working!
4.1 ★ | 10 Vote
You should read it
- Install Windows XP from a USB Flash drive
- How to install Windows 10 from USB with ISO file
- Things you need to know about how to install Windows today
- Install Win 7 from your hard drive, no need for USB, install Win disk
- How to install Windows with WinToHDD without USB, DVD
- Install Windows 10 with a super fast USB in just a few simple steps
- Install Python Package with PIP on Windows, Mac and Linux
- 8 ways to fix the problem of not being able to install Firefox on Windows
May be interested
- How to Send Mail in Linuxthis wikihow teaches you some basic ways to send email on your linux desktop system. if you're using a desktop version of linux like debian or ubuntu, the operating system comes with a built-in graphical mail app called thunderbird. if you...
- How to Start a Prboom Multi Player Game in Linuxthis is how to start a prboom multi-player game in linux from the terminal inside of the gui. this tutorial is for playing over a local area network (lan) with up to 4 players. make sure you do it from the terminal from inside the gui. if...
- How to Install Software on Linuxthis wikihow teaches you how to download and install new apps on your computer, using a linux operating system. in most linux distributions, there is a dedicated app that comes with a simple graphical user interface (gui) for installing...
- How to Use Jolicloudjolicloud is both a google chrome web app, and the menu system of joli os, a based operating system that is aimed for those who want web-based apps, such as google docs and tweetdeck, seamlessly integrated into their normal computer...
- How to Install JDK in Linuxthis wikihow teaches you how to install the latest version of jdk (java 12) on debian, ubuntu, and linux mint using the linux rising ppa repository. press to open a new terminal window. if you're already at the command prompt, just skip to...
- How to Manage Users in Linuxunlike windows, as a unix-like system, linux was conceived of as a multi-user system from its inception. the following sections deal with user management through the linux command line. type adduser -d /home/users/ into the command line.