8 Replies - 209 Views - Last Post: 28 June 2014 - 09:14 PM

#1 conure  Icon User is offline

  • D.I.C Head

Reputation: 17
  • View blog
  • Posts: 99
  • Joined: 03-August 12

Help with phpmyadmin error on Ubuntu

Posted 28 June 2014 - 11:38 AM

Hello all,

I have tried to install LAMP on Ubuntu but have run into a strange problem.

http://pastebin.com/VC6nk7vf

When I click localhost/phpmyadmin the browser is showing me this code. I have searched for solutions and can't find a similar problem - The phpmyadmin line is added in the apache2 config file.

If someone could help I'd be very grateful.

Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Help with phpmyadmin error on Ubuntu

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3719
  • View blog
  • Posts: 5,990
  • Joined: 08-June 10

Re: Help with phpmyadmin error on Ubuntu

Posted 28 June 2014 - 11:43 AM

If any PHP website is showing you actual PHP code when you open it, then it means the web server isn't configured to execute PHP. It'll just show it like it would any other text file.

How did you set up your LAMP server? Through the Ubuntu repos or through some sort of package, like XAMPP?

If it's through the repos, the simplest explanation would be that you didn't install PHP properly with the server. Try to just:
$ sudo apt-get install php5


Was This Post Helpful? 0
  • +
  • -

#3 conure  Icon User is offline

  • D.I.C Head

Reputation: 17
  • View blog
  • Posts: 99
  • Joined: 03-August 12

Re: Help with phpmyadmin error on Ubuntu

Posted 28 June 2014 - 11:46 AM

Hi Atli,

Thanks very much for your help - PHP is installed and PHP -v showsPHP 5.5.9

I'm not too experienced with Linux but followed this guide:

https://www.digitalo...stack-on-ubuntu
Was This Post Helpful? 0
  • +
  • -

#4 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3719
  • View blog
  • Posts: 5,990
  • Joined: 08-June 10

Re: Help with phpmyadmin error on Ubuntu

Posted 28 June 2014 - 01:10 PM

If you are doing $ php -v on the command line, then that doesn't necessarily mean that PHP has been installed properly for Apache. The command line and Apache packages are actually two different things.

Instead, try creating a PHP file in your web-root (by default at /var/www) and put <?php phpinfo(); in there. If that prints the PHP info when opened in a browser, then it's set up correctly.
Was This Post Helpful? 0
  • +
  • -

#5 astonecipher  Icon User is offline

  • Major DIC Head
  • member icon

Reputation: 671
  • View blog
  • Posts: 2,951
  • Joined: 03-December 12

Re: Help with phpmyadmin error on Ubuntu

Posted 28 June 2014 - 01:28 PM

How far did you get throught the tutorial? From the terminal what happens when you put this in,

sudo service apache2 status

If that doesn't work then this,

sudo /etc/init.d/apache2 status


One of those should give the status of your web server.
Was This Post Helpful? 0
  • +
  • -

#6 conure  Icon User is offline

  • D.I.C Head

Reputation: 17
  • View blog
  • Posts: 99
  • Joined: 03-August 12

Re: Help with phpmyadmin error on Ubuntu

Posted 28 June 2014 - 02:48 PM

Hi guys,

Thanks for your help so far, I completed the entire tutorial. The server is running (I use localhost and it reports Apache2 is online, as does the command you just gave me astonecipher). PHP seems to be installed as I put test.php which works and runs PHP code normally. I'm very confused about why I'm just getting this code back in the browser!

View PostAtli, on 28 June 2014 - 01:10 PM, said:

If you are doing $ php -v on the command line, then that doesn't necessarily mean that PHP has been installed properly for Apache. The command line and Apache packages are actually two different things.

Instead, try creating a PHP file in your web-root (by default at /var/www) and put <?php phpinfo(); in there. If that prints the PHP info when opened in a browser, then it's set up correctly.


I did this and it works correctly - so confused about why PHP my admin won't work!
Was This Post Helpful? 0
  • +
  • -

#7 astonecipher  Icon User is offline

  • Major DIC Head
  • member icon

Reputation: 671
  • View blog
  • Posts: 2,951
  • Joined: 03-December 12

Re: Help with phpmyadmin error on Ubuntu

Posted 28 June 2014 - 02:52 PM

For my clarification, are you pressing a button to go there? An alternative would be to use xampp. Or get comfortable with the terminal and access mysql with,

mysql -u root :-P

To open it.
Was This Post Helpful? 0
  • +
  • -

#8 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3467
  • View blog
  • Posts: 11,770
  • Joined: 12-December 12

Re: Help with phpmyadmin error on Ubuntu

Posted 28 June 2014 - 02:54 PM

Quote

The phpmyadmin line is added in the apache2 config file.

I don't use LAMP but in WAMP (and XAMPP) it is not necessary to add anything to a config file for localhost/phpmyadmin to be recognised.

Perhaps by adding to the config file you are creating a redirect(?) to a text file. Try removing, or commenting out, the entry you made to the config.

I assume LAMP has a control panel and you may have an option to go to phpmyadmin from there. Try this and have a look at what appears in the addressbar.

This post has been edited by andrewsw: 28 June 2014 - 02:57 PM

Was This Post Helpful? 0
  • +
  • -

#9 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3719
  • View blog
  • Posts: 5,990
  • Joined: 08-June 10

Re: Help with phpmyadmin error on Ubuntu

Posted 28 June 2014 - 09:14 PM

View Postandrewsw, on 28 June 2014 - 09:54 PM, said:

I assume LAMP has a control panel and you may have an option to go to phpmyadmin from there. Try this and have a look at what appears in the addressbar.

That's not the case. The LAMP stack in the Ubuntu repos (and probably most other Linux system repos) isn't a developer targeted package like XAMPP or WampServer. It just makes each component of the LAMP stack available for easy install, none of which includes a control panel or even PhpMyAdmin. - I think there is now a meta-package that will install them all at once, but it's just a thin wrapper around the underlying packages.

If you aren't comfortable managing Apache, MySQL and PHP and their respective config files via the Ubuntu terminal, and you are just trying to set up a development environment, you may in fact be better of with XAMPP.

Also keep in mind that PhpMyAdmin is in no way a require component for PHP/MySQL development, even though packages like XAMPP and WampServer tend to include it by default. The MySQL Workbench software from the actual MySQL developers is available for both Linux and Windows (and Mac). If PhpMyAdmin is giving you trouble, I'd suggest at least trying this instead.


How did you install PhpMyAdmin by the way? Did you just download it from their website and dump it into /var/www, or did you install it via the Ubuntu package manager?
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1