Skip to content

Instantly share code, notes, and snippets.

@nuriel77
Last active March 17, 2018 00:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nuriel77/fc02d1a8da8289e7d96c436b2443b09f to your computer and use it in GitHub Desktop.
Save nuriel77/fc02d1a8da8289e7d96c436b2443b09f to your computer and use it in GitHub Desktop.
example install apach2 php7.0
### INSTALL COMMAND:
root@test001:/home/ubuntu# apt-get -y install apache2 php7.0 libapache2-mod-php7.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libgd3 libjbig0 libtiff5 libvpx3 libxslt1.1
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
apache2-bin apache2-data libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.1-0 php-common php7.0-cli php7.0-common php7.0-json php7.0-opcache php7.0-readline
Suggested packages:
www-browser apache2-doc apache2-suexec-pristine | apache2-suexec-custom php-pear
The following NEW packages will be installed:
apache2 apache2-bin apache2-data libapache2-mod-php7.0 libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.1-0 php-common php7.0 php7.0-cli php7.0-common
php7.0-json php7.0-opcache php7.0-readline
0 upgraded, 14 newly installed, 0 to remove and 0 not upgraded.
Need to get 4,769 kB of archives.
After this operation, 19.5 MB of additional disk space will be used.
Get:1 http://internal-az.clouds.archive.ubuntu.com/ubuntu xenial/main amd64 libaprutil1-dbd-sqlite3 amd64 1.5.4-1build1 [10.6 kB]
Get:2 http://internal-az.clouds.archive.ubuntu.com/ubuntu xenial/main amd64 libaprutil1-ldap amd64 1.5.4-1build1 [8,720 B]
Get:3 http://internal-az.clouds.archive.ubuntu.com/ubuntu xenial/main amd64 liblua5.1-0 amd64 5.1.5-8ubuntu1 [102 kB]
Get:4 http://internal-az.clouds.archive.ubuntu.com/ubuntu xenial-updates/main amd64 apache2-bin amd64 2.4.18-2ubuntu3.5 [925 kB]
Get:5 http://internal-az.clouds.archive.ubuntu.com/ubuntu xenial-updates/main amd64 apache2-data all 2.4.18-2ubuntu3.5 [162 kB]
Get:6 http://internal-az.clouds.archive.ubuntu.com/ubuntu xenial-updates/main amd64 apache2 amd64 2.4.18-2ubuntu3.5 [86.7 kB]
Get:7 http://internal-az.clouds.archive.ubuntu.com/ubuntu xenial-updates/main amd64 php-common all 1:35ubuntu6.1 [10.8 kB]
Get:8 http://internal-az.clouds.archive.ubuntu.com/ubuntu xenial-updates/main amd64 php7.0-common amd64 7.0.25-0ubuntu0.16.04.1 [840 kB]
Get:9 http://internal-az.clouds.archive.ubuntu.com/ubuntu xenial-updates/main amd64 php7.0-json amd64 7.0.25-0ubuntu0.16.04.1 [16.8 kB]
Get:10 http://internal-az.clouds.archive.ubuntu.com/ubuntu xenial-updates/main amd64 php7.0-opcache amd64 7.0.25-0ubuntu0.16.04.1 [77.0 kB]
Get:11 http://internal-az.clouds.archive.ubuntu.com/ubuntu xenial-updates/main amd64 php7.0-readline amd64 7.0.25-0ubuntu0.16.04.1 [12.8 kB]
Get:12 http://internal-az.clouds.archive.ubuntu.com/ubuntu xenial-updates/main amd64 php7.0-cli amd64 7.0.25-0ubuntu0.16.04.1 [1,287 kB]
Get:13 http://internal-az.clouds.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libapache2-mod-php7.0 amd64 7.0.25-0ubuntu0.16.04.1 [1,229 kB]
Get:14 http://internal-az.clouds.archive.ubuntu.com/ubuntu xenial-updates/main amd64 php7.0 all 7.0.25-0ubuntu0.16.04.1 [1,290 B]
Fetched 4,769 kB in 1s (2,615 kB/s)
Selecting previously unselected package libaprutil1-dbd-sqlite3:amd64.
(Reading database ... 105051 files and directories currently installed.)
Preparing to unpack .../libaprutil1-dbd-sqlite3_1.5.4-1build1_amd64.deb ...
Unpacking libaprutil1-dbd-sqlite3:amd64 (1.5.4-1build1) ...
Selecting previously unselected package libaprutil1-ldap:amd64.
Preparing to unpack .../libaprutil1-ldap_1.5.4-1build1_amd64.deb ...
Unpacking libaprutil1-ldap:amd64 (1.5.4-1build1) ...
Selecting previously unselected package liblua5.1-0:amd64.
Preparing to unpack .../liblua5.1-0_5.1.5-8ubuntu1_amd64.deb ...
Unpacking liblua5.1-0:amd64 (5.1.5-8ubuntu1) ...
Selecting previously unselected package apache2-bin.
Preparing to unpack .../apache2-bin_2.4.18-2ubuntu3.5_amd64.deb ...
Unpacking apache2-bin (2.4.18-2ubuntu3.5) ...
Selecting previously unselected package apache2-data.
Preparing to unpack .../apache2-data_2.4.18-2ubuntu3.5_all.deb ...
Unpacking apache2-data (2.4.18-2ubuntu3.5) ...
Selecting previously unselected package apache2.
Preparing to unpack .../apache2_2.4.18-2ubuntu3.5_amd64.deb ...
Unpacking apache2 (2.4.18-2ubuntu3.5) ...
Selecting previously unselected package php-common.
Preparing to unpack .../php-common_1%3a35ubuntu6.1_all.deb ...
Unpacking php-common (1:35ubuntu6.1) ...
Selecting previously unselected package php7.0-common.
Preparing to unpack .../php7.0-common_7.0.25-0ubuntu0.16.04.1_amd64.deb ...
Unpacking php7.0-common (7.0.25-0ubuntu0.16.04.1) ...
Selecting previously unselected package php7.0-json.
Preparing to unpack .../php7.0-json_7.0.25-0ubuntu0.16.04.1_amd64.deb ...
Unpacking php7.0-json (7.0.25-0ubuntu0.16.04.1) ...
Selecting previously unselected package php7.0-opcache.
Preparing to unpack .../php7.0-opcache_7.0.25-0ubuntu0.16.04.1_amd64.deb ...
Unpacking php7.0-opcache (7.0.25-0ubuntu0.16.04.1) ...
Selecting previously unselected package php7.0-readline.
Preparing to unpack .../php7.0-readline_7.0.25-0ubuntu0.16.04.1_amd64.deb ...
Unpacking php7.0-readline (7.0.25-0ubuntu0.16.04.1) ...
Selecting previously unselected package php7.0-cli.
Preparing to unpack .../php7.0-cli_7.0.25-0ubuntu0.16.04.1_amd64.deb ...
Unpacking php7.0-cli (7.0.25-0ubuntu0.16.04.1) ...
Selecting previously unselected package libapache2-mod-php7.0.
Preparing to unpack .../libapache2-mod-php7.0_7.0.25-0ubuntu0.16.04.1_amd64.deb ...
Unpacking libapache2-mod-php7.0 (7.0.25-0ubuntu0.16.04.1) ...
Selecting previously unselected package php7.0.
Preparing to unpack .../php7.0_7.0.25-0ubuntu0.16.04.1_all.deb ...
Unpacking php7.0 (7.0.25-0ubuntu0.16.04.1) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for systemd (229-4ubuntu21.1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Setting up libaprutil1-dbd-sqlite3:amd64 (1.5.4-1build1) ...
Setting up libaprutil1-ldap:amd64 (1.5.4-1build1) ...
Setting up liblua5.1-0:amd64 (5.1.5-8ubuntu1) ...
Setting up apache2-bin (2.4.18-2ubuntu3.5) ...
Setting up apache2-data (2.4.18-2ubuntu3.5) ...
Setting up apache2 (2.4.18-2ubuntu3.5) ...
Enabling module mpm_event.
Enabling module authz_core.
Enabling module authz_host.
Enabling module authn_core.
Enabling module auth_basic.
Enabling module access_compat.
Enabling module authn_file.
Enabling module authz_user.
Enabling module alias.
Enabling module dir.
Enabling module autoindex.
Enabling module env.
Enabling module mime.
Enabling module negotiation.
Enabling module setenvif.
Enabling module filter.
Enabling module deflate.
Enabling module status.
Enabling conf charset.
Enabling conf localized-error-pages.
Enabling conf other-vhosts-access-log.
Enabling conf security.
Enabling conf serve-cgi-bin.
Enabling site 000-default.
Setting up php-common (1:35ubuntu6.1) ...
Setting up php7.0-common (7.0.25-0ubuntu0.16.04.1) ...
Creating config file /etc/php/7.0/mods-available/calendar.ini with new version
Creating config file /etc/php/7.0/mods-available/ctype.ini with new version
Creating config file /etc/php/7.0/mods-available/exif.ini with new version
Creating config file /etc/php/7.0/mods-available/fileinfo.ini with new version
Creating config file /etc/php/7.0/mods-available/ftp.ini with new version
Creating config file /etc/php/7.0/mods-available/gettext.ini with new version
Creating config file /etc/php/7.0/mods-available/iconv.ini with new version
Creating config file /etc/php/7.0/mods-available/pdo.ini with new version
Creating config file /etc/php/7.0/mods-available/phar.ini with new version
Creating config file /etc/php/7.0/mods-available/posix.ini with new version
Creating config file /etc/php/7.0/mods-available/shmop.ini with new version
Creating config file /etc/php/7.0/mods-available/sockets.ini with new version
Creating config file /etc/php/7.0/mods-available/sysvmsg.ini with new version
Creating config file /etc/php/7.0/mods-available/sysvsem.ini with new version
Creating config file /etc/php/7.0/mods-available/sysvshm.ini with new version
Creating config file /etc/php/7.0/mods-available/tokenizer.ini with new version
Setting up php7.0-json (7.0.25-0ubuntu0.16.04.1) ...
Creating config file /etc/php/7.0/mods-available/json.ini with new version
Setting up php7.0-opcache (7.0.25-0ubuntu0.16.04.1) ...
Creating config file /etc/php/7.0/mods-available/opcache.ini with new version
Setting up php7.0-readline (7.0.25-0ubuntu0.16.04.1) ...
Creating config file /etc/php/7.0/mods-available/readline.ini with new version
Setting up php7.0-cli (7.0.25-0ubuntu0.16.04.1) ...
update-alternatives: using /usr/bin/php7.0 to provide /usr/bin/php (php) in auto mode
update-alternatives: using /usr/bin/phar7.0 to provide /usr/bin/phar (phar) in auto mode
update-alternatives: using /usr/bin/phar.phar7.0 to provide /usr/bin/phar.phar (phar.phar) in auto mode
Creating config file /etc/php/7.0/cli/php.ini with new version
Setting up libapache2-mod-php7.0 (7.0.25-0ubuntu0.16.04.1) ...
Creating config file /etc/php/7.0/apache2/php.ini with new version
Module mpm_event disabled.
Enabling module mpm_prefork.
apache2_switch_mpm Switch to prefork
apache2_invoke: Enable module php7.0
Setting up php7.0 (7.0.25-0ubuntu0.16.04.1) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for systemd (229-4ubuntu21.1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
### CHECK VERSION ###
root@test001:/home/ubuntu# php -v
PHP 7.0.25-0ubuntu0.16.04.1 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.25-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies
### CHECK ENABLED MODULES ###
root@test001:/home/ubuntu# a2query -m
status (enabled by maintainer script)
php7.0 (enabled by maintainer script)
authz_user (enabled by maintainer script)
filter (enabled by maintainer script)
mime (enabled by maintainer script)
auth_basic (enabled by maintainer script)
env (enabled by maintainer script)
setenvif (enabled by maintainer script)
access_compat (enabled by maintainer script)
autoindex (enabled by maintainer script)
negotiation (enabled by maintainer script)
authn_file (enabled by maintainer script)
authz_host (enabled by maintainer script)
authz_core (enabled by maintainer script)
mpm_prefork (enabled by maintainer script)
alias (enabled by maintainer script)
dir (enabled by maintainer script)
deflate (enabled by maintainer script)
authn_core (enabled by maintainer script)
### SAME WARNING: Considering conflict php5 for php7.0:
root@test001:/home/ubuntu# a2enmod
Your choices are: access_compat actions alias allowmethods asis auth_basic auth_digest auth_form authn_anon authn_core authn_dbd authn_dbm authn_file authn_socache authnz_fcgi authnz_ldap authz_core authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex buffer cache cache_disk cache_socache cgi cgid charset_lite data dav dav_fs dav_lock dbd deflate dialup dir dump_io echo env expires ext_filter file_cache filter headers heartbeat heartmonitor ident include info lbmethod_bybusyness lbmethod_byrequests lbmethod_bytraffic lbmethod_heartbeat ldap log_debug log_forensic lua macro mime mime_magic mpm_event mpm_prefork mpm_worker negotiation php7.0 proxy proxy_ajp proxy_balancer proxy_connect proxy_express proxy_fcgi proxy_fdpass proxy_ftp proxy_html proxy_http proxy_scgi proxy_wstunnel ratelimit reflector remoteip reqtimeout request rewrite sed session session_cookie session_crypto session_dbd setenvif slotmem_plain slotmem_shm socache_dbm socache_memcache socache_shmcb speling ssl status substitute suexec unique_id userdir usertrack vhost_alias xml2enc
Which module(s) do you want to enable (wildcards ok)?
php7.0
Considering conflict php5 for php7.0:
Module php7.0 already enabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment