FOGMulticastManager and other services fail posix_getpid()
-
I am running RedHat 7 on VMWARE EMX virtual. After clean install I get the following error on FOG processes.
FOGMulticastManager[13688]: PHP Fatal error: Call to undefined function posix_getpid() in /opt/fog/service/lib/service_lib.php on line 195
Also the common error of the /opt/fog/log only has a servicemaster.log
I already set the rc.local to delay startup with 30 sec as proposed in a previous thread. but so far still the same -
If I run the php command posix_getpid() seperately there is no problem
-
@leonj said in FOGMulticastManager and other services fail posix_getpid():
If I run the php command posix_getpid() seperately there is no problem
What do you mean by “seperately”? When running PHP code on a command shell?
One thing I found is this: http://php.net/manual/de/function.posix-getpid.php
Possible explanation is that the
process
module is only enabled in thephp.ini
config for the CLI but not for the webserver. Take a look at those configs in /etc/php… -
@Sebastian-Roth Hi Sebastien I placed a small test php script in the http docroot and run it from the webserver
/var/www/fog/test.php
<?php
echo “result of posix_getpid()”;
echo posix_getpid();
?> -
@leonj I got it the wrong way, ups. FOGMulticastManager is called from the console and therefore the module might not be enabled for the CLI version of PHP and might cause the issue. Please try:
php /var/www/fog/test.php
You’ll probably see the same error message as posted above. Run
php --ini
to see where the configuration is located and if the module is enabled. -
@Sebastian-Roth The problem seems resolved now. The repos that we have internally , because several versions of packages are available , the package names are eg. rh-php56 . This causes a problem when the services need to be started via systemd on RedHat . I created symlinks for php (/usr/bin/php) to point to the correct location of the binaries. Also I created symlinks in /etc/ for php.ini and php.d to point to the correct location. The location I found by running phpinfo() in a script from /var/www/fog/
The usual :
<?php
phpinfo();
?>
This then aligns the cli version (and of course what systemd uses) with what the webserver (apache) uses -
@leonj said:
The repos that we have internally …
This would have been a very valuable information right from the start.
Good to hear you got it solved.