LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-31-2018, 12:08 PM   #1
linuxbear64
LQ Newbie
 
Registered: May 2011
Posts: 5

Rep: Reputation: 0
Trouble with PHP on Linux Mint 18.3


I recently installed Apache, MariaDB, and PHP on Linux Mint 18.3. I was doing something geeky with converting Unix time to regular times and putting them in a table. It worked fine on my old computer which also used Mint. On my new installation I am having no end of trouble. Instead of a table I get just a bunch of gobbledygook on my screen. I copied and pasted the old file to the new computer via USB. I'm not sure what I should do here.
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2018-03-31 12-13-52.jpg
Views:	17
Size:	276.6 KB
ID:	27351  
 
Old 03-31-2018, 01:31 PM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 3,437

Rep: Reputation: 1054Reputation: 1054Reputation: 1054Reputation: 1054Reputation: 1054Reputation: 1054Reputation: 1054Reputation: 1054
You should tell your webserver to execute files with extension '.php' with the php-handler.
Apache httpd.conf:
Code:
LoadModule php7_module modules/libphp7.so
<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>

Last edited by NevemTeve; 03-31-2018 at 01:35 PM.
 
Old 04-02-2018, 08:22 AM   #3
Habitual
LQ 5k Club
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: High Sierra
Posts: 8,816
Blog Entries: 23

Rep: Reputation: Disabled
</VacantStare>

Last edited by Habitual; 04-02-2018 at 08:24 AM. Reason: double postage
 
Old 04-02-2018, 08:23 AM   #4
Habitual
LQ 5k Club
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: High Sierra
Posts: 8,816
Blog Entries: 23

Rep: Reputation: Disabled
Quote:
Originally Posted by linuxbear64 View Post
I recently installed Apache, MariaDB, and PHP on Linux Mint 18.3.
How did you install exactly? and from where? default repo for Mint?
Maybe just need a php "handler" for apache2?

libapache2-mod-php5
 
Old 04-04-2018, 04:12 PM   #5
linuxbear64
LQ Newbie
 
Registered: May 2011
Posts: 5

Original Poster
Rep: Reputation: 0
I installed it from the Software Manager (probably the default repository, not from the command line). I also installed everything on Zorin 12 via the command line and got the same result. Mint and Zorin are both Ubuntu-based. I cannot find the httpd.conf file anywhere, either in Mint or in Zorin.

Last edited by linuxbear64; 04-04-2018 at 04:13 PM.
 
Old 04-04-2018, 04:58 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,834

Rep: Reputation: 2079Reputation: 2079Reputation: 2079Reputation: 2079Reputation: 2079Reputation: 2079Reputation: 2079Reputation: 2079Reputation: 2079Reputation: 2079Reputation: 2079
The gobbledygook looks like your php code. If the php module is not installed or loaded correctly then it will not be parsed. If it was installed then apache might not have been restarted or there are other errors.

What happens when you run the command.

sudo apt-get install libapache2-mod-php7.0

Here is a quick php script that you can create and run in your browser to show your PHP environment.
Code:
<? phpinfo(); ?>
 
1 members found this post helpful.
Old 04-04-2018, 10:56 PM   #7
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,634

Rep: Reputation: 1462Reputation: 1462Reputation: 1462Reputation: 1462Reputation: 1462Reputation: 1462Reputation: 1462Reputation: 1462Reputation: 1462Reputation: 1462
Quote:
I cannot find the httpd.conf file anywhere, either in Mint or in Zorin.
In Ubuntu based systems, /etc/apach2/apache2.conf
 
Old 04-05-2018, 08:07 AM   #8
Habitual
LQ 5k Club
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: High Sierra
Posts: 8,816
Blog Entries: 23

Rep: Reputation: Disabled
Quote:
Originally Posted by linuxbear64 View Post
I installed it from the Software Manager (probably the default repository, not from the command line). I also installed everything on Zorin 12 via the command line and got the same result. Mint and Zorin are both Ubuntu-based. I cannot find the httpd.conf file anywhere, either in Mint or in Zorin.
So? Salt and sugar look the same.

/etc/apache2/apache2.conf

Doesn't need editing in most cases.

httpd.conf reference...is CentOS nomenclature (maybe apache.src...?)
/etc/httpd/httpd.conf

Where are you reading?

Easy Linux Tips Project - by Pjotr
and/or
https://help.ubuntu.com

and https://help.ubuntu.com/lts/serverguide/httpd.html

Last edited by Habitual; 04-05-2018 at 08:15 AM.
 
Old 04-05-2018, 09:01 AM   #9
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,078

Rep: Reputation: 675Reputation: 675Reputation: 675Reputation: 675Reputation: 675Reputation: 675
apache2.conf... I guess httpd.conf sounded too cryptic so it has to be renamed
 
Old 04-07-2018, 10:46 AM   #10
linuxbear64
LQ Newbie
 
Registered: May 2011
Posts: 5

Original Poster
Rep: Reputation: 0
Problem Solved!

I entered the command "sudo apt-get install libapache2-mod-php7.0" as MichaelK recommended. Now I have the nice neat tables I was looking for. Thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Having trouble loading Linux mint 17.3 captainleeward Linux - Desktop 8 03-19-2016 05:44 PM
[LINUX MINT] Having trouble maintaining a Wi-Fi connection. commandrix Linux - Networking 2 03-01-2016 09:37 PM
[SOLVED] Trouble installing Linux Mint 16 L.Jones Linux - Laptop and Netbook 9 02-02-2014 03:21 PM
trouble installing linux mint nasa_pete Linux - Newbie 2 09-19-2010 10:58 PM
VPN trouble in Linux Mint Vikvik Linux - Newbie 1 01-03-2010 09:50 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration