LinuxQuestions.org
Visit Jeremy's Blog.
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 06-24-2023, 10:42 AM   #1
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Rep: Reputation: Disabled
PHP Config


All,

I have LAMP installed on my server but PHP is not rendering at either the command line or the browser. Running "PHP -v" gives:
  • PHP 7.2.24-0ubuntu0.18.04.15

When trying to find a HOWTO on doing a PHP Config all I get are install help pages, but I have no inet at this sever location and all those pages talk about a package "fpm", which I do not have so under /etc I only have:
  • /etc/PHP/7.2/apache2
  • /etc/PHP/7.2/cgi
  • /etc/PHP/7.2/cli

So not sure about how to edit these for the right parms and I know there is a place where "PHP" must be added for apache to actually read and interpret any PHP file.

A link to the right config HOWTO is all I need!

All help appreciated!

TBotNik
 
Old 06-24-2023, 01:14 PM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,269

Rep: Reputation: 5341Reputation: 5341Reputation: 5341Reputation: 5341Reputation: 5341Reputation: 5341Reputation: 5341Reputation: 5341Reputation: 5341Reputation: 5341Reputation: 5341
The keywords "Ubuntu" and "LAMP" didn't get you anything?

https://www.digitalocean.com/communi...k-ubuntu-18-04
 
Old 06-24-2023, 01:45 PM   #3
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 415
Blog Entries: 2

Rep: Reputation: Disabled
Add this to your cgi-bin directory as phpinfo.php and run it: http(s)://SITE/cgi-bin/phpinfo.php

Here is a link:

https://www.a2hosting.com/kb/develop...-php-settings/
 
Old 06-24-2023, 02:31 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,827

Rep: Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964
Quote:
but PHP is not rendering
What are you trying to "render"?

Version 7.2 is correct for Ubuntu 18 assuming you installed it from the repository. In theory if you installed php from the repository it should be already configured. Maybe you need to install another php module.
 
Old 07-04-2023, 12:37 PM   #5
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
All,

Worked through the PHP configs and tried to restart apace2 but getting errors.

Looked in the systrmctl logs and it says error on line 228 of a file in /etc but always trucatesthe line so can not figure out what file to edit and find the error.

All help on another way to find this error appreciated!

TBNK
 
Old 07-04-2023, 03:43 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,827

Rep: Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964
Have you checked the logs? What did you change?
 
Old 07-04-2023, 09:38 PM   #7
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 415
Blog Entries: 2

Rep: Reputation: Disabled
Apache log is in /var/log/httpd/error_log typically. Or you can check syntax with "apachectl configtest".
 
Old 07-07-2023, 03:43 PM   #8
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
Apache log is in /var/log/httpd/error_log typically. Or you can check syntax with "apachectl configtest".
elgrandeperro,

On Kubuntu 18.04 and no such commands or logs

TBNK
 
Old 07-07-2023, 03:48 PM   #9
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
Have you checked the logs? What did you change?
michaelk,

Changed nothing in Apache2. May have had this issue for a while, but now aware of it.

Somewhat challenged here as this is a remote sie with no inet.

Only my phone gets out here and no connection between phone and the server.

TBNK
 
Old 07-07-2023, 04:57 PM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,827

Rep: Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964
The Apache2 logs are at /var/log/apache2

To see the entire line run the command:
journalctl -xefu apache2.service

What were the last changes you made to any configuration file in /etc/. That would be the first place to look to see why Apache isn't starting.

Last edited by michaelk; 07-07-2023 at 04:59 PM.
 
Old 07-08-2023, 01:53 PM   #11
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by dugan View Post
The keywords "Ubuntu" and "LAMP" didn't get you anything?

https://www.digitalocean.com/communi...k-ubuntu-18-04
dugan,

Only installs which are meaningless for a remote server with no inet. ABSOLUTELY need only config HOWTOS, nothing else. Not reading through ton of meaningless install BS.

But thanks!

TBNK
 
Old 07-08-2023, 02:00 PM   #12
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
Apache log is in /var/log/httpd/error_log typically. Or you can check syntax with "apachectl configtest".
elgrandeperro,

Error logs in Ubuntu based system are totally different place bu under the same /var/log main directory. The error.log.1 shows 3 lines but has much less information than the systrmctl logs had. No file name and therefore no line number where the error is occurring!

So any other ideas?

TBNK
 
Old 07-08-2023, 02:03 PM   #13
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
The Apache2 logs are at /var/log/apache2

To see the entire line run the command:
journalctl -xefu apache2.service

What were the last changes you made to any configuration file in /etc/. That would be the first place to look to see why Apache isn't starting.
michaelk,

Read my comment to elgrandeperro. Think it answers on this!

TBNK
 
Old 07-08-2023, 02:07 PM   #14
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 796

Original Poster
Rep: Reputation: Disabled
All,

Gonna try a CAT of the systrmctl logs to see if that will give me that error line without cutting it off!

TBNK
 
Old 07-08-2023, 09:59 PM   #15
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 415
Blog Entries: 2

Rep: Reputation: Disabled
So if it is a startup error, often it is recorded in /var/log/messages or /var/log/syslog. It should be named as service httpd or apache2.

You can try to start it, then go to /var/log. Then ls -lt to see what files have recently changed.

Syslog usually is setup so critical errors go into those logfiles.
 
  


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