2

I tear my hair, it's been almost one day I try to reinstall lampp but it doesn't work.

It's been almost one day I try to reinstall lampp on my ubuntu 14.04 LTS in vain. I installed first lamp with php 5.5.9 and everything worked ( I was developing my site without problems ) and I wanted to update my php to php7 . Then I installed php7 but when I did phpinfo () in my website , I saw that version was still 5.5.9 whereas the command line php -v telling me that I had to version 7 . So, I tried removing and reinstalling lamp , I followed several tutorials and unfortunately I always errors.

To reinstall lamp, I follow this tutorial : tuto here. But when I did sudo apt-get install apache2, I have these errors :

start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-server-5.6 (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up php5-mysqlnd (5.5.9+dfsg-1ubuntu4.16) ...

Creating config file /etc/php5/mods-available/mysqlnd.ini with new version
cp: cannot create regular file '/etc/php5/mods-available/mysqlnd.ini': No such file or directory
dpkg: error processing package php5-mysqlnd (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of phpmyadmin:
 phpmyadmin depends on php5-mysql | php5-mysqli | php5-mysqlnd; however:
  Package php5-mysql is not installed.
  Package php5-mysqli is not installed.
  Package php5-mysqlnd is not configured yet.

dpkg: error processing package phpmyadmin (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          Errors were encountered while processing:
 mysql-server-5.6
 php5-mysqlnd
 phpmyadmin
E: Sub-process /usr/bin/dpkg returned an error code (1)

Results of dpkg --configure -a :

Setting up php5-mysqlnd (5.5.9+dfsg-1ubuntu4.16) ...

Creating config file /etc/php5/mods-available/mysqlnd.ini with new version
cp: cannot create regular file '/etc/php5/mods-available/mysqlnd.ini': No such file or directory
dpkg: error processing package php5-mysqlnd (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up mysql-server-5.6 (5.6.30-0ubuntu0.14.04.1) ...
2016-05-10 13:08:00 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-05-10 13:08:00 0 [Note] /usr/sbin/mysqld (mysqld 5.6.30-0ubuntu0.14.04.1) starting as process 15565 ...
2016-05-10 13:08:00 15565 [Note] Plugin 'FEDERATED' is disabled.
2016-05-10 13:08:00 15565 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-05-10 13:08:00 15565 [Note] InnoDB: The InnoDB memory heap is disabled
2016-05-10 13:08:00 15565 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-05-10 13:08:00 15565 [Note] InnoDB: Memory barrier is not used
2016-05-10 13:08:00 15565 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-05-10 13:08:00 15565 [Note] InnoDB: Using Linux native AIO
2016-05-10 13:08:00 15565 [Note] InnoDB: Using CPU crc32 instructions
2016-05-10 13:08:00 15565 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-05-10 13:08:00 15565 [Note] InnoDB: Completed initialization of buffer pool
2016-05-10 13:08:00 15565 [Note] InnoDB: Highest supported file format is Barracuda.
2016-05-10 13:08:00 15565 [Note] InnoDB: 128 rollback segment(s) are active.
2016-05-10 13:08:00 15565 [Note] InnoDB: Waiting for purge to start
2016-05-10 13:08:01 15565 [Note] InnoDB: 5.6.30 started; log sequence number 1626679
2016-05-10 13:08:01 15565 [Note] Binlog end
2016-05-10 13:08:01 15565 [Note] InnoDB: FTS optimize thread exiting.
2016-05-10 13:08:01 15565 [Note] InnoDB: Starting shutdown...
2016-05-10 13:08:02 15565 [Note] InnoDB: Shutdown completed; log sequence number 1626689
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-server-5.6 (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 php5-mysqlnd
 mysql-server-5.6

Thanks !

EDIT : I found the solution, I uninstall successively, mysql and php and then the installation of apache works.

The commands I did (Maybe some commands are useless, but after that it works):

sudo apt-get purge mysql-client-core-5.6
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get install mysql-client-core-5.5
sudo apt-get install mysql-server  

sudo apt-get -y purge php.*
  • Welcome to AskUbuntu! Please try sudo dpkg --configure -a and tell us what the output is. – Jos May 10 '16 at 9:46
  • @Jos sorry I wasn't on my laptop, I edited my post – KhoyaDev May 10 '16 at 11:08
  • It looks like you are trying to install several packages, but in the wrong order: mysql-server-5.6 is not yet installed correctly (that is why it won't start), but before that you tried to install php5-mysqlnd which failed because there is no /etc/php5/mods-available directory. Sort out mysql-server first, then make sure php5 works, then retry php5-mysqlnd. Then, worry about migrating to php7. – Jos May 10 '16 at 11:18
  • @Jos thank you, I'm not very familiar with unix, how I sort out mysql-server ? – KhoyaDev May 10 '16 at 11:23
  • 1. retry the start command: sudo service mysql start (probably gives you "Job failed to start" again); 2. look in /var/log/mysql/error.log; 3. look in the Upstart log /var/log/upstart. – Jos May 10 '16 at 11:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.