Fossology installation -php error

In the step of /usr/local/lib/fossology/fo-postinstall ,error

Disclaimer: Dieser Thread wurde aus dem alten Forum importiert. Daher werden eventuell nicht alle Formatierungen richtig angezeigt. Der ursprüngliche Thread beginnt im zweiten Post dieses Threads.

Fossology installation -php error
Hello,

When the installation of fossology was processed ,there is one issue related to php.

In the step of /usr/local/lib/fossology/fo-postinstall.

1.Then error shows:

*** Running postinstall for web-only actions***
*** Setting up the FOSSology database ***
NOTE: fossology database already exists, not creating
*** Checking for plpgsql support ***
NOTE: plpgsql already exists in fossology database, good
*** update the database and license_ref table ***
[color=crimson]PHP Warning: Invalid argument supplied for foreach() in /usr/local/lib/fossology/fossinit.php on line 58
X-Powered-By: PHP/5.4.16
Content-type: text/html[/color]

[color=crimson]FATAL! System Configuration Error, no SYSCONFDIR.
X-Powered-By: PHP/5.4.16
Content-type: text/html[/color]

##################################################################

2.I have seen the code but I still could not figure out how to solve it.

Code:

51 $sysconfdir = ‘’;
52 $delDbPattern = ‘the option -rfosstest will drop data bases with datname like “fosstest%”’;
53 /* command-line options /
54 $Options = getopt($AllPossibleOpts);
55
56
57
[color=crimson]58
59 foreach($Options as $optKey => $optVal)
60 {
61 switch($optKey)
62 {
63 case ‘c’: /
set SYSCONFIDR /
64 $sysconfdir = $optVal;
65 break;
66 case ‘d’: /
optional database name /
67 $DatabaseName = $optVal;
68 break;
69 case ‘f’: /
schema file /
70 $SchemaFilePath = $optVal;
71 break;
72 case ‘h’: /
help /
73 explainUsage();
74 case ‘l’: /
update the license_ref table /
75 $UpdateLiceneseRef = true;
76 break;
77 case ‘v’: /
verbose */
78 $Verbose = true;
79 break;
80 case ‘r’:
81 $delDbPattern = $optVal ? “$optVal%” : “fosstest%”;
82 break;
83 default:
84 echo “Invalid Option "$optKey".\n”;
85 explainUsage();
86 }
87 }

[/color]

#############################################
3.Here is the whole information about execute the scripts:

[color=crimson][root@localhost fossology]# /usr/local/lib/fossology/fo-postinstall
*** Running postinstall for everything ***
*** Running postinstall for common actions***
*** Creating user and group ***
NOTE: group ‘fossy’ already exists, good.
NOTE: user ‘fossy’ already exists, good.
*** Making sure needed dirs exist with right ownership/permissions ***
*** clearing file cache ***
NOTE: Repository already exists at /srv/fossology/repository
NOTE: Running the PostgreSQL vacuum and analyze command can result in a large database performance improvement. We suggest that you either configure postgres to run its autovacuum and autoanalyze daemons, or maintagent -D in a cron job, or run Admin > Maintenance on a regular basis. Admin > Dashboard will show you the last time vacuum and analyze have been run.
*** Running postinstall for web-only actions***
*** Setting up the FOSSology database ***
NOTE: fossology database already exists, not creating
*** Checking for plpgsql support ***
NOTE: plpgsql already exists in fossology database, good
*** update the database and license_ref table ***
PHP Warning: Invalid argument supplied for foreach() in /usr/local/lib/fossology/fossinit.php on line 58
X-Powered-By: PHP/5.4.16
Content-type: text/html

FATAL! System Configuration Error, no SYSCONFDIR.
X-Powered-By: PHP/5.4.16
Content-type: text/html

FATAL! System Configuration Error, no SYSCONFDIR.
FATAL: unable to connect to database, please check /usr/local/etc/fossology/Db.conf[/color]
#####################################################################################

Could you please provide any hint on this issue?

Thanks very much!

Best regards


Hello,

I have googled the issue and found if I insert (array) in foreach($Options as $optKey => $optVal) ,the issue disappeared.

Code:
59 foreach((array)$Options as $optKey => $optVal)
60 {
61 switch($optKey)
62 {

But still I have warning and error informaiton about :

[color=crimson]NOTE: plpgsql already exists in fossology database, good
*** update the database and license_ref table ***
X-Powered-By: PHP/5.4.16
Content-type: text/html

FATAL! System Configuration Error, no SYSCONFDIR.
X-Powered-By: PHP/5.4.16
Content-type: text/html[/color]

FATAL! System Configuration Error, no SYSCONFDIR.
FATAL: unable to connect to database, please check /usr/local/etc/fossology/Db.conf

Can someone provide any suggestion?:slight_smile:

Thanks in advance!


Hello,

It seems I found the issue.The reason that the installation failed is due to the version of php and some patches for php.
Here is the solution I use:
1)yum listed install|grep -i php

remove the old version by using yum remove php****

then
2)
yum new version of php 5.6

a.Yum the php repo
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm

b.Installation:
yum install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64 php56w-odbc.x86_64 php56w-xml.x86_64 php56w-xmlrpc.x86_64 php56w-soap.x86_64

After that then yum install php56w-pgsql,php56w-posix

3)run /usr/local/lib/fossology/fo-postinstall

[root@localhost conf]# /usr/local/lib/fossology/fo-postinstall
*** Running postinstall for everything ***
*** Running postinstall for common actions***
*** Creating user and group ***
NOTE: group ‘fossy’ already exists, good.
NOTE: user ‘fossy’ already exists, good.
*** Making sure needed dirs exist with right ownership/permissions ***
*** clearing file cache ***
NOTE: Repository already exists at /srv/fossology/repository
NOTE: Running the PostgreSQL vacuum and analyze command can result in a large database performance improvement. We suggest that you either configure postgres to run its autovacuum and autoanalyze daemons, or maintagent -D in a cron job, or run Admin > Maintenance on a regular basis. Admin > Dashboard will show you the last time vacuum and analyze have been run.
*** Running postinstall for web-only actions***
*** Setting up the FOSSology database ***
NOTE: fossology database already exists, not creating
*** Checking for plpgsql support ***
NOTE: plpgsql already exists in fossology database, good
*** update the database and license_ref table ***
PHP Warning: date_default_timezone_get(): It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone ‘UTC’ for now, but please set date.timezone to select your timezone. in /usr/local/share/fossology/vendor/monolog/monolog/src/Monolog/Logger.php on line 233
Old release was 3.1.0
Applying database functions
DB schema has been updated for fossology.
Database schema update completed successfully.
Update reference licenses
PHP Warning: date_default_timezone_get(): It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone ‘UTC’ for now, but please set date.timezone to select your timezone. in /usr/local/share/fossology/vendor/monolog/monolog/src/Monolog/Logger.php on line 233
Database connectivity is good.
*** Setting up scheduler ***
*** Setting up the web interface ***
NOTE: Adding user apache to group fossy
FOSSology postinstall complete, but sure to complete the remaining

But I still configure apache to see the result.So if there is any other suggestion ,please provide it.

Thanks!


Hello ,

It’s me again:-)

Still I met one problem when I access http://localhost/repo

error shows:
[Mon Jun 18 15:20:18.849342 2018] [:error] [pid 23484] [client 192.168.217.140:48996] PHP Fatal error: require_once(): Failed opening required ‘/var/local/cache/fossology/container.php’ (include_path=‘.:/usr/share/pear:/usr/share/php’) in /usr/local/share/fossology/lib/php/common-container.php on line 37
[Mon Jun 18 15:20:19.214416 2018] [:error] [pid 23480] [client 192.168.217.140:48998] PHP Warning: require_once(/var/local/cache/fossology/container.php): failed to open stream: Permission denied in /usr/local/share/fossology/lib/php/common-container.php on line 37
[Mon Jun 18 15:20:19.214464 2018] [:error] [pid 23480] [client 192.168.217.140:48998] PHP Fatal error: require_once(): Failed opening required ‘/var/local/cache/fossology/container.php’ (include_path=‘.:/usr/share/pear:/usr/share/php’) in /usr/local/share/fossology/lib/php/common-container.php on line 37
[Mon Jun 18 15:21:32.574838 2018] [:error] [pid 23481] [client 192.168.217.140:49000] PHP Warning: require_once(/var/local/cache/fossology/container.php): failed to open stream: Permission denied in /usr/local/share/fossology/lib/php/common-container.php on line 37
[Mon Jun 18 15:21:32.574931 2018] [:error] [pid 23481] [client 192.168.217.140:49000] PHP Fatal error: require_once(): Failed opening required [color=crimson]‘/var/local/cache/fossology/container.php’ (include_path=‘.:/usr/share/pear:/usr/share/php’) in /usr/local/share/fossology/lib/php/common-container.php on line 37
[Mon Jun 18 15:21:33.138572 2018] [:error] [pid 23482] [client 192.168.217.140:49002] PHP Warning: require_once(/var/local/cache/fossology/container.php): failed to open stream: Permission denied in /usr/local/share/fossology/lib/php/common-container.php on line 37
[Mon Jun 18 15:21:33.138618 2018] [:error] [pid 23482] [client 192.168.217.140:49002] PHP Fatal error: require_once(): Failed opening required ‘/var/local/cache/fossology/container.php’ (include_path=‘.:/usr/share/pear:/usr/share/php’) in /usr/local/share/fossology/lib/php/common-container.php on line 37[/color]

I could 't figuer out any clue,please provide your suggestion.

Best regards


Hello,

I have add the question to https://github.com/fossology/fossology/issues/1123 ,please provide your suggestion if you have any discovery.

Thanks!


Hello ,

The issue has been solved.

The issue is due to the selinux status .

Please set selinux to disbled.

There are 2 approches:

1)setenforce 0

2)vim ./etc/sysconfig/selinux

find selinux = enabled and change it into selinux = disabled.

Restartt linux server.(reboot)

Tada…completed :slight_smile:

Best regards

1 „Gefällt mir“