PHP is not working well on Ubuntu 13.10 and mcrypt is missing in phpmyadmin

Solution 1:

Try this for your mcrypt problem:

mv -i /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/
sudo php5enmod mcrypt
sudo service apache2 restart

It's a bug with the location of the mcrypt.ini file, I got the info from here.

I had the same bug, I did a cp instead of a mv to be sure but it solved the problem.

For PHP not working, if you get phpmyadmin working (even with the mcrypt error), it means PHP is working (because phpmyadmin uses PHP). But in your example <? echo $row['details']; ?> change <? to <?php and try again?

Solution 2:

For the second problem about, lots of PHP lines are printed in textbox's like: echo $row['details'];

Edit your php.ini config file (for apache):

sudo nano -w /etc/php5/apache2/php.ini

and change:

short_open_tag = Off

to:

short_open_tag = On

Solution 3:

Check all your scripts under /etc/php5/conf.d/ because they will have stopped working. In my case, imap also stopped working.

Solved the problem with the symbolic link trick (as root):

ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/mcrypt.ini
php5enmod mcrypt
ln -s /etc/php5/conf.d/imap.ini /etc/php5/mods-available/imap.ini
php5enmod imap
service apache2 restart

Solution 4:

(I would have posted this as a comment above but don't have the privileges.)

Whatts' intuition to use cp instead of mv was a good one. For example, if you are using the Laravel 4 framework, the artisan CLI will detect mcrypt.ini in /etc/php5/mods-available/, but the framework itself seems to look for it in /etc/php5/conf.d/. You need a copy of it in both locations for everything to work:

cp -i /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/
sudo php5enmod mcrypt
sudo service apache2 restart