0

I'm using ubuntu Linux 12.04 LTS on my machine. I was using PHP 5.3.10 Now I upgraded to PHP 5.5.18 by using few commands on terminal. After I upgraded to latest PHP version I checked the version by using command php -v. It shown me the PHP version is 5.5.18. But when I tried to access one directory from the folder "www" i.e. document root I'm getting error "Unable to connect" in browser. When I enter only localhost in address bar "It Works" is the message appearing.

So I tried to restart the apache server ny using following command :

sudo service apache2 restart

then I got following error :

 * Restarting web server apache2                                         [fail] 
 * The apache2 configtest failed.
Output of config test was:
apache2: Syntax error on line 214 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/httpd.conf: No such file or directory
Action 'configtest' failed.
The Apache error log may have more information.

After reading this message I go to the file /etc/apache2/httpd.conf and checked line no. 214 there I got found following statement written :

Include httpd.conf

So can someone please help me in working the thing as it is like previous for me? Please suggest me the ways I can fix this issue.

Thanks on advance.

PHPLover
  • 1
  • 51
  • 158
  • 311
  • Does the `/etc/apache2/httpd.conf` exist? Check to see whether you renamed or moved it previously and update the reference in the `apache2.conf` file. – Joe Oct 19 '14 at 13:33
  • @Joe:No, it's not existing. – PHPLover Oct 19 '14 at 13:33
  • Ok, then just try to find out where your httpd.conf file is located and update the `Include`: http://stackoverflow.com/questions/12202021/where-is-my-httpd-conf-file-located-apache – Joe Oct 19 '14 at 13:35
  • @Joe: Itried using this command : sudo find / -name httpd.conf but it shown nothing to me. – PHPLover Oct 19 '14 at 13:43
  • Have you tried the commands from the first answer? – Joe Oct 19 '14 at 13:43
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/63307/discussion-between-phplover-and-joe). – PHPLover Oct 19 '14 at 13:48

3 Answers3

0

just do this:

a2dismod php5

OR

a2dismod php7.0
Machavity
  • 30,841
  • 27
  • 92
  • 100
Marouen Mhiri
  • 1,640
  • 1
  • 14
  • 20
0

it also woked for me

sudo a2dismod php7.0

Module php7.0 disabled.
To activate the new configuration, you need to run:
  service apache2 restart


mr@mr ~/Desktop $ sudo service apache2 restart
 * Restarting web server apache2
Community
  • 1
  • 1
0
  1. Check if two symbolic link there for php same version [cd /etc/apache2/mods-enabled/]

    • php7.load -> ../mods-available/php7.load

    • php7.load -> ../mods-available/php7.0.load

    • I have removed one of them according to my requirement

  2. Check available modes in [/etc/apache2/mods-available/]

    • Php7.0.load

    • Php7.load

    • I have removed one of them [php7.load] Enable on of the mode restart apache server
Manish
  • 639
  • 6
  • 17