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 ?

up vote 49 down vote accepted

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?

  • 1
    thank you , your answer fixed all of my issues. <? ?> is not working any more ? in the newer version of php ? it has to be <?php ?> to work ? – Mohammad_Hosseini Oct 19 '13 at 22:43
  • I just googled it and it seems short tags are not active by default anymore. You can switch it back on, but it's best practice to always use <?php – Whatts Oct 20 '13 at 7:25
  • thanks in advance ,but still there is a bit of a problem , in some of my php pages I don't know what is the problem , when I try to load this pages just a white blanket page is showing, I've tried enabling error reporting for php on the top the page but still nothing shows on the page. this might not be a good place to ask this question but since I've brought this issue I asked again . if you need me to put some of the codes here tell me, thanks. – Mohammad_Hosseini Oct 20 '13 at 9:10
  • A completely white page usually means a missing bracket or semicolon. Or calling a function that doesn't exist. If you don't have a software development environment that can help you, try commenting out parts of your code one block at a time (start comments with /* and finish with */ , everything in between is commented out). I usually start with about half the code commented out and then try to display, then always narrowing down to where the error is). – Whatts Oct 20 '13 at 16:24

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
  • awesome guide , thanks solved white page problem too – Mohammad_Hosseini Oct 30 '13 at 19:55

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
  • your way is not working it gives me error of no existence either imap or mcrypt but what @whatts said worked for me . – Mohammad_Hosseini Oct 21 '13 at 10:40

(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

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

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.

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.

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

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.