Page 1 of 1

Something went wrong with PHP

Posted: Wed Feb 01, 2023 7:31 pm
by Toberius
Hi, I was performing a new check list install ZM framework and now when I load localhost/zm can't get framework ZM but an extensive php header like this:

Code: Select all

<?php
//
// ZoneMinder main web interface file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
// 
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// 

error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);

$debug = false;
if ( $debug ) {
  // Use these for debugging, though not both at once!
  phpinfo(INFO_VARIABLES);
}

// Use new style autoglobals where possible
if ( version_compare(phpversion(), '4.1.0', '<') ) {
  $_SESSION = &$HTTP_SESSION_VARS;
  $_SERVER = &$HTTP_SERVER_VARS;
}

....  continue with more lines  .....

Code: Select all

rc-status -a | grep -E 'apache2|mysql|php-fpm|zoneminder'
 mysql                                                             [  started  ]
 apache2                                                           [  started  ]
 zoneminder                                                        [  started  ]
 php-fpm                                                           [  started  ]

Code: Select all

eselect php list apache2
  [1]   php8.1 *
I would appreciate any hint.

Regards.

Re: Something went wrong with PHP

Posted: Wed Feb 01, 2023 9:03 pm
by Magic919
Sounds like you need to enable PHP with Apache.

Re: Something went wrong with PHP

Posted: Wed Feb 01, 2023 10:05 pm
by gkmac
Magic919 wrote: Wed Feb 01, 2023 9:03 pm Sounds like you need to enable PHP with Apache.
The "eselect" command suggests you're using Gentoo.

If you are using Gentoo, check the file /etc/conf.d/apache2 and look for APACHE2_OPTS. Make sure that "-D PHP" is added to that line, as described here.

Re: Something went wrong with PHP

Posted: Wed Feb 01, 2023 11:03 pm
by Toberius
Thanks guys for response.
Magic919 wrote: Wed Feb 01, 2023 9:03 pm Sounds like you need to enable PHP with Apache.
I had misconfigured 70_mod_php.conf.

Now PHP works.

Image

gkmac wrote: Wed Feb 01, 2023 10:05 pm
The "eselect" command suggests you're using Gentoo.

If you are using Gentoo, check the file /etc/conf.d/apache2 and look for APACHE2_OPTS. Make sure that "-D PHP" is added to that line, as described here.
You are rigth, I ran on gentoo.

APACHE_OPTS is fine but, zm stopped working.

Re: Something went wrong with PHP

Posted: Sat Feb 04, 2023 4:27 am
by Toberius
[update]

I was able to make it work ZM but using LAN IP 192.168.0.2/zm, no works with localhost/zm anymore.

Hints ?

Regards.

Re: Something went wrong with PHP

Posted: Sat Feb 04, 2023 7:33 am
by Magic919
You don’t sound like a real Gentoo user.

Have a look at the listen address in your Apache directives. Sounds like you have bound it to that LAN IP.

Re: Something went wrong with PHP

Posted: Sun Feb 05, 2023 5:08 pm
by Toberius
Magic919 wrote: Sat Feb 04, 2023 7:33 am You don’t sound like a real Gentoo user.

I have 4 boxes running gentoo that I installed myself.

I don't know what a real gentoo user is.

Could you explain us what it is ?
Could you clarify us what does it mean to be a real gentoo user?
Is it about artificial intelligence ?

Sir, the question I asked is not about gentoo, it is about what this forum and its users make use of.

I hope you can answer us this answer if you are able to do so.

You don't seem to be a real user of this forum. Just answer the questions if you know them or keep quiet.

Let me explain a little bit what the forums are, someone asks a question and that question is very likely to represent many other users. Then, there are two contributors, the one who asks the question and the one who answers correctly. In neither of these cases are you.

Re: Something went wrong with PHP

Posted: Sun Feb 05, 2023 6:22 pm
by Magic919
You are funny. I’ll be sure to add you to my ignore list.