Categories

See More
Popular Forum

MBA (4887) B.Tech (1769) Engineering (1486) Class 12 (1030) Study Abroad (1004) Computer Science and Engineering (988) Business Management Studies (865) BBA (846) Diploma (746) CAT (651) B.Com (648) B.Sc (643) JEE Mains (618) Mechanical Engineering (574) Exam (525) India (462) Career (452) All Time Q&A (439) Mass Communication (427) BCA (417) Science (384) Computers & IT (Non-Engg) (383) Medicine & Health Sciences (381) Hotel Management (373) Civil Engineering (353) MCA (349) Tuteehub Top Questions (348) Distance (340) Colleges in India (334)
See More

PHP is not working on ubuntu 14

General Tech Bugs & Fixes

Max. 2000 characters
Replies

usr_profile.png

User

( 5 months ago )

 

I am trying to install php on my ubuntu machine. 1st I install apache2 on machine.... after that I install php7

sudo apt-get -y update
sudo add-apt-repository ppa:ondrej/php
sudo apt-get -y update
sudo apt-get install -y php7.0 libapache2-mod-php7.0 php7.0 php7.0-common php7.0-gd php7.0-mysql php7.0-mcrypt php7.0-curl php7.0-intl php7.0-xsl php7.0-mbstring php7.0-zip php7.0-bcmath php7.0-iconv

after that I restart my apache2 service apache2 restart

but still php is not working when I try to browse php page from localhost.

php -v

is also showing me output.... and telling me the php version.

in error log file of apche2 I got errors

restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Thu May 19 07:53:16.813504 2016] [mpm_prefork:notice] [pid 12487] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.16 configured -- resuming normal operations
[Thu May 19 07:53:16.813518 2016] [core:notice] [pid 12487] AH00094: Command line: '/usr/sbin/apache2'
[Thu May 19 08:05:24.435502 2016] [mpm_prefork:notice] [pid 12487] AH00169: caught SIGTERM, shutting down
[Thu May 19 08:05:25.513275 2016] [mpm_prefork:notice] [pid 14456] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.16 configured -- resuming normal operations
[Thu May 19 08:05:25.513343 2016] [core:notice] [pid 14456] AH00094: Command line: '/usr/sbin/apache2'
[Thu May 19 08:26:11.093404 2016] [mpm_prefork:notice] [pid 14456] AH00169: caught SIGTERM, shutting down
[Thu May 19 08:26:12.166600 2016] [mpm_prefork:notice] [pid 20497] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.16 configured -- resuming normal operations
[Thu May 19 08:26:12.166640 2016] [core:notice] [pid 20497] AH00094: Command line: '/usr/sbin/apache2'

usr_profile.png

User

( 5 months ago )

If you install libapache2-mod-php7.0 in addition to libapache2-mod-php5 it will not enable itself (you should see this in {apt,dpkg}.log), so you need to disable php5 module and enable php7.0 module:

 

a2dismod php5

a2enmod php7.0

apache2ctl restart

P.S.: You should read what the packages tells you at the installation time. Running apt-get with -y is a quite sure way how to miss important stuff.

what's your interest


forum_ban8_5d8c5fd7cf6f7.gif