1

When I restart apache server this message appears:

Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.

After that I check status of apache service:

● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: 
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: failed (Result: exit-code) since Mon 2020-02-17 00:44:29 IST; 7min ag
  Process: 24336 ExecStop=/usr/sbin/apachectl stop (code=exited, status=1/FAILUR
  Process: 24865 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAIL
 Main PID: 22462 (code=exited, status=0/SUCCESS)

Feb 17 00:44:29 technicalms systemd[1]: Starting The Apache HTTP Server...
Feb 17 00:44:29 technicalms apachectl[24865]: apache2: Syntax error on line 228 
Feb 17 00:44:29 technicalms apachectl[24865]: Action 'start' failed.
Feb 17 00:44:29 technicalms apachectl[24865]: The Apache error log may have more
Feb 17 00:44:29 technicalms systemd[1]: apache2.service: Control process exited,
Feb 17 00:44:29 technicalms systemd[1]: apache2.service: Failed with result 'exi
Feb 17 00:44:29 technicalms systemd[1]: Failed to start The Apache HTTP Server.

And my browser shows php code like that code (not executed)

<?php
    $libs=glob("app/Libs/*.php");
foreach($libs as $lfile)
{
    include_once $lfile;
}
new Autoload();
?>

Please tell me how can I solve it

3
  • From this The Apache error log may have more, open a terminal and type tail -f /var/log/apache2/*.log then rerun the page and update the question with any errors that will be shown.
    – Parto
    Feb 16, 2020 at 20:55
  • 3
    Fix the "Syntax error on line 228"
    – waltinator
    Feb 16, 2020 at 22:45
  • 4
    Does this answer your question? Apache, problem Failed to start LSB: Apache2 web server It is about the same issue - a typo within your Apache's configuration files. In order to use php you need 1) install php on the server, 2) install and enable the relevant Apache's php module - here are shown more details: askubuntu.com/a/1111949/566421
    – pa4080
    Feb 18, 2020 at 12:22

0

Browse other questions tagged .