ubuntu install php
# Update packages lists
sudo apt update
# Install Apache2 (on Ubuntu, mostly it's already installed)
sudo apt install apache2
# Install the latest version of PHP and Apache wrapper
sudo apt install php libapache2-mod-php
# Install some important PHP extensions, you might need to install more later
sudo apt install php-{bcmath,bz2,curl,gd,json,mbstring,mysql,xml,zip}
# Install MySQL server, and remember to run mysql_secure_installation script after that
sudo apt install mysql-server
# Start MySQL service
sudo systemctl start mysql
# Restart Apache service to reload all changes
sudo systemctl restart apache2
3.7
11
apt-get install php
Thank you!
11
0
3.5
2
apt-get install php-pear php-fpm php-dev php-zip php-curl php-xmlrpc php-gd php-mysql php-mbstring php-xml libapache2-mod-php
Thank you!
2
0
3.83
6
# Update packages lists
sudo apt update
# Install PPA
sudo add-apt-repository ppa:ondrej/php
## If you want the latest
sudo apt install php
## else sepcify version number as below
sudo apt install php7.3
# Install Extensions (add php version number for specific version)
sudo apt-get install php7.3-fpm php7.3 php7.3-cli php7.3-mysql php7.3-gd php7.3-imagick php7.3-recode php7.3-tidy php7.3-xmlrpc php7.3-common php7.3-curl php7.3-mbstring php7.3-xml php7.3-bcmath php7.3-bz2 php7.3-intl php7.3-json php7.3-readline php7.3-zip
# Install the latest version of PHP and Apache wrapper
sudo apt install php libapache2-mod-php
## else if you installed a specific version of PHP
sudo apt install php libapache2-mod-php7.3
# Enable PHP (can type sudo a2enmod php, then push tab to see listed versions)
sudo a2enmod php7.3
# Restart Apache Service
sudo service apache2 restart
Thank you!
6
0
4
8
sudo apt-get install php libapache2-mod-php
Thank you!
8
0
0
0
sudo apt install php libapache2-mod-php
# restart it
sudo systemctl restart apache2
Thank you!
0
0
Are there any code examples left?
New code examples in category PHP
-
PHP 2022-03-27 22:40:03 index:of curiosa 2019 mp4
-
PHP 2022-03-27 22:35:13 Dijkstra’s algorithm php
-
PHP 2022-03-27 22:35:12 get_declared_classes
-
PHP 2022-03-27 22:30:23 php move index of a value to first position in array
-
PHP 2022-03-27 22:25:01 wordpress get_date
-
PHP 2022-03-27 21:30:38 php shorten string with dots
-
PHP 2022-03-27 21:10:46 php header 500
-
PHP 2022-03-27 21:05:06 laravel schedule run
-
PHP 2022-03-27 20:25:12 Get page title, excerpt or content by id
-
PHP 2022-03-27 20:00:27 php convert date from dd/mm/yyyy to yyyy-mm-dd