FOGProject / fogproject

An open source computer cloning & management system
https://fogproject.org
GNU General Public License v3.0
1.14k stars 222 forks source link

Cent7 installs incompatible 5.4.16 from base repo - Need to install remi repo before FOG installs PHP to ensure we get a compatible version. #389

Closed alex4108 closed 4 years ago

alex4108 commented 4 years ago

Installing fog from scratch for first time: Hyper-V Gen1 VM - 8 vCPUs and 1024MB RAM - 128GB VHDX on SAN - gbit lan/wan link that geoIP filters.

TLDR: CentOS 7 Minimal serves php 5.4 from base repos and FOG requires php 5.5 or higher per the error message discovered after clearing php5.4 incompatible syntax. I might've accidentally blocked the FOG installer from fetching an updated version from remi by the firewall on my network implementing GeoIP filtering. Our network is only allowed to call IPs that geolookup to US, CA, MX, GB, or DE.

  1. Install CentOS 7 Minimal.
  2. Log in to shell
    • loaded my ssh key to the authorized_keys
  3. Download fog 1.5.8: wget https://github.com/FOGProject/fogproject/archive/1.5.8.tar.gz
  4. tar zxvf 1.5.8.tar.gz && cd fogproject-1.5.8/bin/ && sudo ./installfog.sh
  5. Prompt to go to webserver/fog/management
  6. Go to endpoint
  7. Get white page, no content. App doesn't seem to be loading....
  8. Dig around httpd logs, find nothing, looked at /var/log/php-fpm/www-error.log, found: [08-May-2020 04:12:15 UTC] PHP Parse error: syntax error, unexpected '&' in /var/www/html/fog/commons/init.php on line 132

Removed the & Now the page says: FOG Requires PHP v5.5.0 or higher. You have PHP v5.4.16 Ok cool! Thank you for a clear error message!! Aha, the installer didn't retrieve the correct version. It looks like the installer just installs via yum. On a clean Cent7 install php 5.4.16 is served by base:

Installed Packages
Name        : php
Arch        : x86_64
Version     : 5.4.16
Release     : 48.el7
Size        : 4.4 M
Repo        : installed
From repo   : base
Summary     : PHP scripting language for creating dynamic web sites
URL         : http://www.php.net/
License     : PHP and Zend and BSD
Description : PHP is an HTML-embedded scripting language. PHP attempts to make it
            : easy for developers to write dynamically generated web pages. PHP also
            : offers built-in database integration for several commercial and
            : non-commercial database management systems, so writing a
            : database-enabled webpage with PHP is fairly simple. The most common
            : use of PHP coding is probably as a replacement for CGI scripts.
            :
            : The php package contains the module (often referred to as mod_php)
            : which adds support for the PHP language to Apache HTTP Server.

We need to be installing php 5.5 or higher, it seems

Here is where we install PHP on a redhat based system: https://github.com/FOGProject/fogproject/blob/master/lib/redhat/config.sh

I can't tell if the repos are being modified or not - I don't see it but I haven't looked that deep yet. Regardless, to fetch php 7.3, we need to enable remi php 7.3 repo first:

yum install epel-release yum-utils
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum-config-manager --enable remi-php73

Now I update all php stuff... yum -y update php* This gave me php7.3 Now I restarted httpd. Now the app is open and I see the install page, asking me to run the mysqldump. AWESOME!!! I clicked the Install button....and.... Now I go put the original & that I removed back into place in init. Didn't seem to change anything, shrug Fog starts now!! Huzzah! I'm able to log in and see a dashboard. Now, to go configuring!

Quazz commented 4 years ago

https://github.com/FOGProject/fogproject/blob/master/lib/common/functions.sh#L627

That function should already be taking care of all that.

I'm guessing something went wrong. Perhaps there's something in bin/error_logs that clarifies it.

alex4108 commented 4 years ago

Ok, CorpNet filtered Remi as I stated during the initial install process. Perhaps a louder alarm during the install process "hey something failed!!" could prove useful in the future. Once I had remi's IP unblocked it worked

Sebastian-Roth commented 4 years ago

@alex4108 Thanks for the update. I will push a change to take care of this in a minute.