LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-02-2023, 09:26 AM   #31
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled

elgrandeperro,

Remenber the command "PHP -v" shows 7.2.24, so PHP is installed but the apache config is still not right so it never recognizes it, That is where I'm at in this problem.

Cheers!

TBNK
 
Old 08-02-2023, 07:19 PM   #32
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
In your /etc/apache2 configuration files there should be a LoadModule directive i.e.
LoadModule php7_module /path/to/libphp7.so

In the php7x.conf file there should be something like below which tells apache to parse php files.
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
 
Old 08-02-2023, 10:14 PM   #33
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
michaelk,

OK! In dir /etc/apache2/mods-enabled/ there is a php7.2.conf and php7.2.load. The <FilesMatch \.php$> is in php7.2.conf file and the <LoadModule php7_module /path/to/libphp7.so> is in the php7.2.load file.

The /etc/apache2/apache2 conf file has include statements for both of these, so should be loading correctly.

Any more ideas?

Cheers!

TBNK
 
Old 08-02-2023, 11:15 PM   #34
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

are you sure that you have the relevant php 7.2 package installed? Check with:
Code:
dpkg -l |grep libapache2-mod-php
Version 7.2 seems very old to me.

Evo2.
 
Old 08-03-2023, 07:54 AM   #35
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 415
Blog Entries: 2

Rep: Reputation: Disabled
If a .php won't render (I only include phpinfo for testing instead of trying to get phpmyadmin to work, because it is small and easily checked. If it doesn't work, you don't have either the right packages installed or not enabled apache using php via the module. Go over the phpmyadmin install to apache and check that you have installed all software and enabled php in apache.

You've missed something very basic.

Again, if phpinfo.php does not work, there is NO way that apache/php is installed right.

Check the module is loaded:

https://www.tecmint.com/check-apache-modules-enabled/

Last edited by elgrandeperro; 08-03-2023 at 08:03 AM.
 
Old 08-04-2023, 01:01 PM   #36
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by evo2 View Post
Hi,

are you sure that you have the relevant php 7.2 package installed? Check with:
Code:
dpkg -l |grep libapache2-mod-php
Version 7.2 seems very old to me.

Evo2.
evo2,

I'm on Kubuntu 18.04 LTS

cheers!

TBNK
 
Old 08-04-2023, 01:41 PM   #37
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by elgrandeperro View Post
If a .php won't render (I only include phpinfo for testing instead of trying to get phpmyadmin to work, because it is small and easily checked. If it doesn't work, you don't have either the right packages installed or not enabled apache using php via the module. Go over the phpmyadmin install to apache and check that you have installed all software and enabled php in apache.

You've missed something very basic.

Again, if phpinfo.php does not work, there is NO way that apache/php is installed right.

Check the module is loaded:

https://www.tecmint.com/check-apache-modules-enabled/
elgrandeperro,

I even tested several.php files in the command line and they also do not render, they only print out the code like an echo statement, which should be independent of apache, so yes guessing something wrong in the basic PHP config.

Since ports.conf was erroring, will put that in a paste bin, cause it only had 80 and 443 as ports defined and I saw nothing standing out that should cause errors.

Last edited by TBotNik; 08-07-2023 at 02:25 PM.
 
Old 08-04-2023, 06:43 PM   #38
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Quote:
Originally Posted by TBotNik View Post
I'm on Kubuntu 18.04 LTS
Did you check that apache module is actually installed?

Evo2.
 
Old 08-05-2023, 07:52 AM   #39
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 415
Blog Entries: 2

Rep: Reputation: Disabled
So running "php phpinfo.php" returns what?

where

Code:
<?php
phpinfo();
?>
should give you something like:


~/php $ php phpinfo.php | head
phpinfo()
PHP Version => 7.4.33

System => Linux ubuntu20 5.15.0-78-generic #85~20.04.1-Ubuntu SMP Mon Jul 17 09:42:39 UTC 2023 x86_64
Build Date => Jun 8 2023 15:23:07
....
 
Old 08-05-2023, 07:58 AM   #40
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
You can also test php via the command line

php -i

php -r 'echo "Hello World\n";'
 
Old 08-07-2023, 02:26 PM   #41
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by evo2 View Post
Did you check that apache module is actually installed?

Evo2.
evo2,

Yes it is!

Cheers!

TBNK
 
Old 08-09-2023, 04:59 PM   #42
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
michaelk,

Ran php -i from the command line and posted the outpu at:

https://controlc.com/d9146354

Hope this helps.

Cheers!

TBNK
 
Old 08-09-2023, 06:06 PM   #43
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
A quick glance but looks reasonably ok. Did you try running a command i.e.

php -r 'echo "Hello World\n";'
 
Old 08-11-2023, 06:00 PM   #44
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
A quick glance but looks reasonably ok. Did you try running a command i.e.

php -r 'echo "Hello World\n";'
michaelk,

I'll try that and see what happens, but remember running:
Quote:
php /mypath/myfile.php
only get an "echo" on the file contents.

TBNK
 
Old 08-11-2023, 08:43 PM   #45
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
Command failed

michaelk,

Ran your cmd: PHP 'echo "Hello World";'

And it did was display that as code so showed it all verbatim with no processing because if it had processed only

Hello World

would have been displayed!

See why I'm confused!

Cheers!

TBNK
 
  


Reply

Tags
apache, config, php



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Which config: config.amd64-none_amd64 OR config.amd64_rt_amd64 mzsade Debian 2 11-27-2016 09:19 PM
[SOLVED] Am trying to install packages like net-snmp, php-mysql, php-snmp, php but with errors Maj Linux - Newbie 1 07-26-2013 02:12 PM
PHP - Mail.php and Mail/mime.php issues LVsFINEST Linux - Server 1 02-08-2009 05:44 PM
PHP parse error in config.inc.php.in Confusedious Linux - Software 2 11-03-2005 05:08 AM
php apache or php cgi - php learner rblampain Linux - Security 3 12-17-2004 11:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:31 PM.

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
Open Source Consulting | Domain Registration