Koozali.org formerly Contribs.org

ibay php debug / log location

ibay php debug / log location
« on: April 15, 2021, 04:46:20 PM »
Hi, just doing some testing of SME 10 and always used the /var/log/messages log for output of php warnings and errors on SME 9 but I don't seem to be getting any outputs in 10. Manuals all seem to relate to SME 9 and older and I have been through my SME php.ini file and made a few changes to match my old server but no dice. Any ideas? Thanks,

php.ini settings at the minute are

error_reporting                        = E_ALL & ~E_NOTICE
display_errors                         = On
display_startup_errors                 = On
log_errors                             = On
log_errors_max_len                     = 1024
ignore_repeated_errors                 = Off
ignore_repeated_source                 = Off
report_memleaks                        = On
track_errors                           = On
html_errors                            = On
error_log                              = syslog


php seems to be executing ok when I test basic echo scripts but don't get any output from

<? phpinfo() ?>
« Last Edit: April 15, 2021, 05:35:13 PM by Bozely »

Offline Jean-Philippe Pialasse

  • *
  • 1,768
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: ibay php debug / log location
« Reply #1 on: April 15, 2021, 05:42:21 PM »
php log is in /var/log/php/php$ver/error.log


where $ver is the php version used for that ibay. 74 as default if not changes

phpinfo is a dangerous function as it exposes a lot of information about you server to potential attackers and as a treat it is disabled by default and in the list of disabled function which can be modified. 


i can encourage you to install smeserver-webhosting if in need to tweak php for ibays.
« Last Edit: April 15, 2021, 05:44:31 PM by Jean-Philippe Pialasse »

Re: ibay php debug / log location
« Reply #2 on: April 15, 2021, 06:04:01 PM »
Thank you, I see  /var/log/php/[ibay name]/error.log has what I was looking for. Yes, it's just a dev server I am playing around with, I'll be sure not to leave a production system in the same state.  :-P

Offline Jean-Philippe Pialasse

  • *
  • 1,768
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: ibay php debug / log location
« Reply #3 on: April 15, 2021, 06:11:07 PM »
by the way php.ini is not very relevant here as we do not use php as httpd module but rather use php-fpm. so info is int the php-fpm.d/www.conf of the relevant version of php.
so by default

/etc/opt/remi/php74/php-fpm.d/www.conf

Re: ibay php debug / log location
« Reply #4 on: April 15, 2021, 06:18:11 PM »
Super helpful, thank you.

Re: ibay php debug / log location
« Reply #5 on: April 16, 2021, 01:24:15 PM »
Trying to configure output of phpinfo to aid some of my debugging and trying to configure php-odbc (Call to undefined function odbc_connect()) but having no luck.

In /etc/opt/remi/php74/php-fpm.d/ I have removed phpinfo from www.conf and ibays.conf for the ibay I am testing from disabled functions.

Code: [Select]
php_admin_value[disable_functions] = system, show_source, symlink, exec, dl, shell_exec, passthru, phpinfo, escapeshellarg, $
followed by a web server restart

Code: [Select]
systemctl restart httpd-e-smith.service
For all my changes it doesn't seem to affect what I would expect. Am I updating the correct config files? Not using templates just yet while I mess around with it.

Re: ibay php debug / log location
« Reply #6 on: April 16, 2021, 02:16:45 PM »
Sorry I had bad syntax in the .conf files and the service systemctl restart php74-php-fpm.service was failing as a result.

Offline Jean-Philippe Pialasse

  • *
  • 1,768
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: ibay php debug / log location
« Reply #7 on: April 17, 2021, 12:23:53 AM »

In /etc/opt/remi/php74/php-fpm.d/ I have removed phpinfo from www.conf and ibays.conf for the ibay I am testing from disabled functions.

well yes that is the path but not relevant to know it.

followed by a web server restart

Code: [Select]
systemctl restart httpd-e-smith.service
nope , double nope
php74-php-fpm has its own service

few services including httpd-e-smith will do a expand-template on restart to prevent some failure to start. so you can not mess up the files and restart the service



For all my changes it doesn't seem to affect what I would expect. Am I updating the correct config files? Not using templates just yet while I mess around with it.

well just start using the contribution i pointed.  all the available options are in the manager.  really no reason to start trying to break your server without the GUI !

Re: ibay php debug / log location
« Reply #8 on: April 20, 2021, 12:09:29 PM »
Quote
nope , double nope
  :lol:

I caught that just before your response. What can I say, I like to tinker! I have a snapshot of a fresh vm so I crash around and break things and sometimes learn things along the way. It's different to my usual setup so I am trying to find my feet. I installed the contrib you mention and it was helpful.

Apologies for going off topic but I need to connect to a SQL express installation. What would you recommend for this within the SME10 setup?

I've previously used FreeTDS but I am having trouble understanding how to enable php extensions Koozali style  :-)