0

I use Ubuntu 18.04.

Command sudo service apache2 restart returns an error.

  kurusa kernel: apache2[17035]: segfault at 7f478cc64e00 ip 00007f4788e13fcf sp 00007ffdb66f0620 error 6 in libphp7.0.so[7f4788bc1000+390000]
  kurusa apachectl[17032]: Segmentation fault (core dumped)
  kurusa apachectl[17032]: Action 'start' failed.

These are some lines from journalctl -xe result:

   kurusa anacron[16951]: Anacron 2.3 started on 2018-12-19
   kurusa anacron[16951]: Normal exit (0 jobs run)
   kurusa wpa_supplicant[1022]: TDLS: Invalid frame - payloadtype=1 category=240 action=10
   kurusa wpa_supplicant[1022]: TDLS: Invalid frame - payloadtype=1 category=240 action=10
   kurusa sudo[17006]:   kurusa : TTY=pts/0 ; PWD=/etc ; USER=root ; COMMAND=/bin/ps -f -p 4489
   kurusa sudo[17006]: pam_unix(sudo:session): session opened for user root by (uid=0)
   kurusa sudo[17006]: pam_unix(sudo:session): session closed for user root
   kurusa sudo[17008]:   kurusa : TTY=pts/0 ; PWD=/etc ; USER=root ; COMMAND=/bin/ps -f -p 2197
   kurusa sudo[17008]: pam_unix(sudo:session): session opened for user root by (uid=0)
   kurusa sudo[17008]: pam_unix(sudo:session): session closed for user root
   kurusa sudo[17011]:   kurusa : TTY=pts/0 ; PWD=/etc ; USER=root ; COMMAND=/bin/kill 2197
   kurusa sudo[17011]: pam_unix(sudo:session): session opened for user root by (uid=0)
   kurusa sudo[17011]: pam_unix(sudo:session): session closed for user root
   kurusa sudo[17021]:   kurusa : TTY=pts/0 ; PWD=/etc ; USER=root ; COMMAND=/bin/ps -f -p 4489
   kurusa sudo[17021]: pam_unix(sudo:session): session opened for user root by (uid=0)
   kurusa sudo[17021]: pam_unix(sudo:session): session closed for user root
   kurusa sudo[17026]:   kurusa : TTY=pts/0 ; PWD=/etc ; USER=root ; COMMAND=/usr/sbin/service apache2 restart
   kurusa sudo[17026]: pam_unix(sudo:session): session opened for user root by (uid=0)

Here is my apache2.conf:

DefaultRuntimeDir ${APACHE_RUN_DIR}
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
KeepAliveTimeout 5
MaxKeepAliveRequests 100
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log

IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
Include ports.conf

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Require all denied
</Directory>

<Directory /usr/share>
    AllowOverride All
    Require all granted
</Directory>

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

<Directory /home/kurusa/proj>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

AccessFileName .htaccess
<FilesMatch "^\.ht">
    Require all denied
</FilesMatch>

IncludeOptional conf-enabled/*.conf
IncludeOptional sites-enabled/*.conf
Include /etc/phpmyadmin/apache.conf

Also the command sudo a2dismod php7.0 returned:

ERROR: /etc/apache2/mods-enabled/php7.0.load is not a symbolic link, not deleting

How can I fix this problem?

Melebius
  • 11,121
  • 8
  • 50
  • 77
Bipa
  • 533
  • 5
  • 9
  • 1
    A segmentation fault means a bug in an application, in this case `libphp7.0.so`. See https://bugs.php.net/bug.php?id=70380. The [default `php` version for 18.04](https://packages.ubuntu.com/bionic/php) is 7.2. Could you specify why and how you installed PHP 7.0? – Melebius Dec 19 '18 at 09:14
  • @Melebius so i just need to install php7.2, enable it and disable 7.0? – Bipa Dec 19 '18 at 09:15
  • I think this might be the same issue: https://stackoverflow.com/questions/49439812/apache-not-starting-in-linux-mint – pLumo Dec 19 '18 at 09:16
  • @Racoon I’d definitely try to upgrade to PHP 7.2 if it’s possible. – Melebius Dec 19 '18 at 09:18
  • @RoVo, `apachectl configtest` returned `Syntax OK` – Bipa Dec 19 '18 at 09:19
  • @Melebius, i instaled php7.2 and `php -v` says that i have `PHP 7.2.13-1`, so i tried to run `sudo a2dismod php7.0`, but it returned error `ERROR: /etc/apache2/mods-enabled/php7.0.load is not a symbolic link, not deleting` – Bipa Dec 19 '18 at 09:20
  • @RoVo and my libphp7.0.so is empty – Bipa Dec 19 '18 at 09:22
  • Check the contents of the `mods-enabled` using the command `ls /etc/apache2/mods-enabled`. PHP 7.0 might have been removed automatically while installing 7.2. Can Apache be started now? – Melebius Dec 19 '18 at 09:31
  • @Melebius apache unable to start. all php modules from `mods-enabled` are `php5.6.conf, php5.6.load, php7.0.conf and php7.0.load`. But `php -v` still show that php php version is php7.2 – Bipa Dec 19 '18 at 09:37
  • 1
    Have you the package [`libapache2-mod-php`](https://packages.ubuntu.com/bionic/libapache2-mod-php) installed correctly? I guess only one version should appear in `mods-enabled` at any time. If you want to switch versions, please check https://askubuntu.com/questions/50344/how-to-have-two-versions-of-php-installed-and-switch-easily-between-them. And please [edit] your question to reflect all the details you posted in comments. It helps to keep our Q&A style tidy and could also bring more attention since an edited question gets bounced on the homepage. – Melebius Dec 19 '18 at 09:48

0 Answers0