answersLogoWhite

0

How do you install PHP in Linux?

Updated: 8/17/2019
User Avatar

Wiki User

12y ago

Best Answer

That depends on what GNU/Linux distribution you're using. On Debian based system (Debian, Ubuntu, etc.), it's as easy as typing:

sudo apt-get install php5

There are of course many add on packages you may want as well. For example, php5-imagick would be a good one if you want to manipulate images on the back end.

Under other distributions, you may need to use different package managers. On Fedora for instance, it would probably be:

sudo yum -y install php5

(if I remember the arguments for yum that is - it's been a while).

If you're using a really old one (e.g. Slackware), you'd need to download the source code and do a direct build usually something like this:

wget http://www.php.net/get/php-5.3.6.tar.bz2/from/ca.php.net/mirror -O php-5.3.6.tar.bz2

tar -jxvf php-5.3.6.tar.bz2

cd php-5.3.6

./configure

make

sudo make install

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you install PHP in Linux?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Will PHP code developed on Windows work on an Apache server on Linux?

Generally speaking, yes. There are certain extensions to PHP one could install on Windows that would provide functions that aren't present on Linux.


Can you run PHP on Linux?

Yes. Many popular websites run PHP on Linux.


What is lamp in php?

LAMP stands for Linux-Apache-MySQL-PHP. In simpler terms it contains everything to build a php application on a linux platform.


Is PHP better on Windows or Linux?

PHP with Linux is completely different, since everything is free (Linux, Apache, Mysql, FileZila, PHP, etc.). Linux is also way more stable for production use, since it's regularly updated (at least once a months, for certain distribution). Remember, the Internet runs on Linux, mostly CentOS and RedHat.However, windows is way more compatible with everyday applications. The best would be to have a development computer running Linux (buy an old, use computer, install Linux on it), and have an everyday Windows computer.


Is PHP runable in Linux?

PHP can run on any major operating system just like java as long as you have an interpreter. Try installing a LAMP (Linux, Apache, MySQL, PHP) server & you should be able to run php on your pc/server. There are some IDE's which would allow php development on linux os


Can you run PHP and MySQL on Linux?

Yes.


How do you find the PHP version in Linux?

In terminal use the following command. php -ver


How to solve what if your php installation appears to be missing the mysql extension which is required by wordpress?

Ideal thing to do would be to delete all your installation & install a single WAMP/LAMP server. It combines all the features necessary to run php including windows/linux, apache, mysql & php


How do you install crystal reports for php?

how to create report in php


How i can begin php in Linux?

PHP on windows runs using the WAMP Server while on Linux it runs using the LAMP Server. Try getting a LAMP Server from a search engine


Why is PHP in Linux?

PHP is a cross platform programming language, it is (in theory) available on any operating system.


How does compiling PHP in Linux and Windows differ?

On Linux you probably already have all or most of the needed tools, so you just run, configure, make, and make install. If it is your first time, you may need to install additional libraries and tweak the configuration. On Windows, you need to install Microsoft Visual C++ with some additional steps explained in the link I am adding as a reference.