16

I've upgraded from UBUNTU 13.04 to 13.10 but I can not work with PHP pages or phpmyadmin . I've tried this way to install lamp on Ubuntu sudo apt-get install lamp-server^ phpmyadmin and I've done all of the configuration correctly after installation I've added this line Include /etc/phpmyadmin/apache.conf to /etc/apache2/apache2.conf then I restarted apache2

Now I have two problems:

  1. In phpmyadmin on the bottom of the page is this error : The mcrypt extension is missing. Please check your PHP configuration I've check and mcrypt was in it , but in phpmyadmin it gives me error of missing .

  2. The other problem is on PHP pages it seems like there is no PHP and it's all html because lots of PHP lines are printed in textbox's like : <? echo $row['details']; ?> Can anybody tell me what should I do ?

8 Answers8

48

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?

Whatts
  • 596
4

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
Joren
  • 5,074
moz667
  • 41
1

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
1

(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
MHG
  • 137
0

Actually the right place for mcrypt.ini file is in mods-available directory not in conf.d. So replacing and enabling mcrypt configuration file, solves this problem.

hg8
  • 13,582
Navid
  • 26
0

In terminal(Ctrl+Alt+T)

1.open file php.ini :

/etc/php5/apache2$sudo nano php.ini

2.replace Off to On :

short_open_tag = On

3.restart apache :

sudo service apache2 restart
A J
  • 11,557
Din
  • 1
-1

I also had a problem with mcrypt after installing Ubuntu 14.04. Following this link should help. www.php.net

  1. Open your php.ini file sudo gedit /etc/php5/apache2/php.ini
  2. Restart your apache2 sudo service apache2 restart

Hope this helps.

Daroath
  • 101
-1

Duplicated question: Mcrypt extension is missing in 14.04 server for mysql

Short answer:

sudo apt-get install mcrypt php5-mcrypt
sudo php5enmod mcrypt
sudo service apache2 restart
thucnguyen
  • 1,519