Errors installing a local SugarCRM environment

Background

We are running Sugar 8.3 Enterprise in the cloud.  I am developing a custom module (REST service) and need to get a local environment running because if I upload and run a bad module it takes down the entire cloud server.  I attempted to follow the documentation listed here but there is no option to download from the Customer Resources tab in sugarcrm.com. 

Steps

I have done the following steps

1. Installed Apache 2.4 on Windows 10

2. Installed PHP 7.1

3. Installed MySQL 8.0

4. Installed Elastic Search 6.5.4

4. Downloaded the backup from our sugarcrm production environment

5. Unzipped into %APACHE_HOME%\htdocs\sugar

My directory structure looks like

Directory Structure

I have these modules enabled in my php.ini file.  I have set the following directives to the recommended values as specified in the SugarCRM documentation:

date.timezone
display_errors
max_input
max_execution_time
mbstring.func_overload
memory_limit
post_max_size
session.use_cookies
session.ciookiehttponly
session.cookielifetime
session.gc_maxlifetime
session.use_trans_sid
upload_max_filesize

In C:\ProgramData\MySQL\my.ini I attempted to add the following line

sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

but when I restart my MySQL service it fails with an error.

I made sure that that the htdocs folder and all content underneath have full permissions for all users.  

I downloaded the curl cacert and added the following line to the php.ini file

curl.cainfo=c:\php\cacert.pem

In my httpd.conf file I did the following:

1. I enabled the the mod_rewrite, mod_headers, and mod_expire, php7_module module

2. I added the following options

     a. Options Indexes FollowSymLinks MultiViews

     b. AllowOverride All

     c. Require all granted

   to the following directory tags

     a. <Directory />

     b. <Directory "${SRVROOT}/htdocs">

     c. <Directory "${SRVROOT}/cgi-bin">

     d. <Directory "${SRVROOT}/htdocs/sugar">

3. I added the following two configs

     a. AddType application/x-httpd-php .php
     b. PHPIniDir "C:/php"

Error

When I navigate to http://localhost/sugar/install.php I get right up to the check config page and always get the following error message

Test for .htaccess rewrites failed. This usually means you do not have AllowOverride set up for Sugar directory.

error

I've been struggling with this for several days.  Can someone please provide assistance here?

In the install.log file I get

2019-05-07 13:16:09...installerHook: Could not find custom/install/install_hooks.php
2019-05-07 13:16:12...installerHook: Could not find custom/install/install_hooks.php
2019-05-07 13:16:15...installerHook: Could not find custom/install/install_hooks.php
2019-05-07 13:16:16...Begin System Check Process *************
2019-05-07 13:16:16...XML Parsing Support Found
2019-05-07 13:16:16...MBString Support Found
2019-05-07 13:16:16...ZIP Support Found
2019-05-07 13:16:16.../custom directory and subdirectory check passed
2019-05-07 13:16:17...cache directory and subdirectory check passed
2019-05-07 13:17:23.../module directory and subdirectory check passed
2019-05-07 13:17:23.../upload directory check passed
2019-05-07 13:17:23.../zip check passed
2019-05-07 13:17:23.../BCMATH check passed
2019-05-07 13:17:23...Testing .htaccess redirects
2019-05-07 13:17:23...installerHook: Could not find custom/install/install_hooks.php
2019-05-07 13:17:23...php.ini location found. C:\php\php.ini
2019-05-07 13:17:23...Outputting HTML for System check
2019-05-07 13:17:23...Errors were found *************
2019-05-07 14:15:08...installerHook: Could not find custom/install/install_hooks.php
2019-05-07 14:15:13...installerHook: Could not find custom/install/install_hooks.php
2019-05-07 14:15:15...installerHook: Could not find custom/install/install_hooks.php
2019-05-07 14:15:17...Begin System Check Process *************
2019-05-07 14:15:17...XML Parsing Support Found
2019-05-07 14:15:17...MBString Support Found
2019-05-07 14:15:17...ZIP Support Found
2019-05-07 14:15:17.../custom directory and subdirectory check passed
2019-05-07 14:15:17...cache directory and subdirectory check passed
2019-05-07 14:16:17.../module directory and subdirectory check passed
2019-05-07 14:16:17.../upload directory check passed
2019-05-07 14:16:17.../zip check passed
2019-05-07 14:16:17.../BCMATH check passed
2019-05-07 14:16:17...Testing .htaccess redirects
2019-05-07 14:16:17...installerHook: Could not find custom/install/install_hooks.php
2019-05-07 14:16:17...php.ini location found. C:\php\php.ini
2019-05-07 14:16:17...Outputting HTML for System check
2019-05-07 14:16:17...Errors were found *************
2019-05-07 14:17:34...Begin System Check Process *************
2019-05-07 14:17:35...XML Parsing Support Found
2019-05-07 14:17:35...MBString Support Found
2019-05-07 14:17:35...ZIP Support Found
2019-05-07 14:17:35.../custom directory and subdirectory check passed
2019-05-07 14:17:35...cache directory and subdirectory check passed
2019-05-07 14:18:32.../module directory and subdirectory check passed
2019-05-07 14:18:32.../upload directory check passed
2019-05-07 14:18:32.../zip check passed
2019-05-07 14:18:32.../BCMATH check passed
2019-05-07 14:18:32...Testing .htaccess redirects
2019-05-07 14:18:32...installerHook: Could not find custom/install/install_hooks.php
2019-05-07 14:18:32...php.ini location found. C:\php\php.ini
2019-05-07 14:18:32...Outputting HTML for System check
2019-05-07 14:18:32...Errors were found *************
2019-05-07 14:19:38...Begin System Check Process *************
2019-05-07 14:19:38...XML Parsing Support Found
2019-05-07 14:19:38...MBString Support Found
2019-05-07 14:19:38...ZIP Support Found
2019-05-07 14:19:38.../custom directory and subdirectory check passed
2019-05-07 14:19:38...cache directory and subdirectory check passed
2019-05-07 14:20:33.../module directory and subdirectory check passed
2019-05-07 14:20:33.../upload directory check passed
2019-05-07 14:20:33.../zip check passed
2019-05-07 14:20:33.../BCMATH check passed
2019-05-07 14:20:33...Testing .htaccess redirects
2019-05-07 14:20:33...installerHook: Could not find custom/install/install_hooks.php
2019-05-07 14:20:33...php.ini location found. C:\php\php.ini
2019-05-07 14:20:33...Outputting HTML for System check
2019-05-07 14:20:33...Errors were found *************
2019-05-07 14:59:14...installerHook: Could not find custom/install/install_hooks.php
2019-05-07 14:59:17...installerHook: Could not find custom/install/install_hooks.php
2019-05-07 14:59:19...installerHook: Could not find custom/install/install_hooks.php
2019-05-07 14:59:21...Begin System Check Process *************
2019-05-07 14:59:21...XML Parsing Support Found
2019-05-07 14:59:21...MBString Support Found
2019-05-07 14:59:21...ZIP Support Found
2019-05-07 14:59:21.../custom directory and subdirectory check passed
2019-05-07 14:59:21...cache directory and subdirectory check passed
2019-05-07 15:00:32.../module directory and subdirectory check passed
2019-05-07 15:00:32.../upload directory check passed
2019-05-07 15:00:32.../zip check passed
2019-05-07 15:00:32.../BCMATH check passed
2019-05-07 15:00:32...Testing .htaccess redirects
2019-05-07 15:00:32...installerHook: Could not find custom/install/install_hooks.php
2019-05-07 15:00:32...php.ini location found. C:\php\php.ini
2019-05-07 15:00:32...Outputting HTML for System check
2019-05-07 15:00:32...Errors were found *************
2019-05-07 15:44:46...installerHook: Could not find custom/install/install_hooks.php
2019-05-07 15:44:57...installerHook: Could not find custom/install/install_hooks.php
2019-05-07 15:45:00...installerHook: Could not find custom/install/install_hooks.php
2019-05-07 15:45:04...Begin System Check Process *************
2019-05-07 15:45:04...XML Parsing Support Found
2019-05-07 15:45:04...MBString Support Found
2019-05-07 15:45:04...ZIP Support Found
2019-05-07 15:45:04.../custom directory and subdirectory check passed
2019-05-07 15:45:04...cache directory and subdirectory check passed
2019-05-07 15:48:16.../module directory and subdirectory check passed
2019-05-07 15:48:16.../upload directory check passed
2019-05-07 15:48:16.../zip check passed
2019-05-07 15:48:16.../BCMATH check passed
2019-05-07 15:48:16...Testing .htaccess redirects
2019-05-07 15:48:16...installerHook: Could not find custom/install/install_hooks.php
2019-05-07 15:48:16...php.ini location found. C:\php\php.ini
2019-05-07 15:48:16...Outputting HTML for System check
2019-05-07 15:48:16...Errors were found *************

But I cant find any information beyond that

  • Try this config at your apache conf:

    <Directory /var/www/html>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
    </Directory>

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • When I add either Order Allow,Deny and/or Allow from all it wont let me start the server.  In the error.log file for my httpd server I get the following lines:

    PHP Warning: PHP Startup: Unable to load dynamic library 'ext\\php_bcmath.dll' - %1 is not a valid Win32 application.\r\n in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library 'ext\\php_hash.dll' - %1 is not a valid Win32 application.\r\n in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library 'ext\\php_jsmin.dll' - The specified module could not be found.\r\n in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library 'ext\\php_json.dll' - %1 is not a valid Win32 application.\r\n in Unknown on line 0
    [Tue May 07 12:58:46.216207 2019] [mpm_winnt:notice] [pid 19112:tid 576] AH00354: Child: Starting 64 worker threads.
    [Tue May 07 13:00:15.642375 2019] [php7:warn] [pid 19112:tid 1328] [client ::1:60231] PHP Warning: file_get_contents(localhost:80/sugar/itest.txt): failed to open stream: No such file or directory in C:\\Apache24\\htdocs\\sugar\\install\\installSystemCheck.php on line 372, referer: http://localhost/sugar/install.php

    It seems like it is an issue with the script writing to or modifying files in the htdocs folder, but I cant seem to find any logs that really substantiate this.  Is there anything I can turn on here to get more information?  I've been struggling hard with this one as im not use to working on windows.

    Also, based off the install logs i do see it says "Errors were found" but it seems to just randomly stop.  Im wondering if its timing out

  • I feel like this is happening because I am trying to create a local environment from a backup I downloaded from our production system.  I modified the config.php file to point to my local db, local elastic search, increase logging, changed the site url, changed the host name, disabled redis, etc but again I dont have an option to download the application from the sugarcrm.com site.  Why is that option not available?

  • Hi Chris Maggiulli,

    I wanted to share a few resources that might help you out here:

    I hope this helps!

    -Alex


    Alex Nassi
    Digital CX Operations Director
    SugarCRM

  • Awesome thank you for the response.  This will help a lot.  I just created a new account with my corporate email and requested that our Sugar admin grant me download access!

  • Alex Nassi I had out sugar admin associate my account with our corporate account an enable my ability to download software packages.  Now I can access that screen but I only can download plugins and a "hint" hook.  Is there somewhere I can verify if we even have the ability to set up local environments?  We are running 8.3 in production but if 8.3 isnt supported for local environments I could run 9 locally since I only need the local env to finish an extension.

    We are enterprise users (not on-site users), but we were under the assumption that we could run local installs with the enterprise edition

  • Chris Maggiulli - cloud only releases (such as 8.3) are able to be set up locally for testing purposes. Using that account that you created (tied to your corporate account), log back into the community and you should be able to access Developer Builds which is where customers can find information about running cloud releases locally. 


    Alex Nassi
    Digital CX Operations Director
    SugarCRM

  • Awesome this got me exactly where I needed to be.  Thank you for walking me through the process

  • I just had the same issue with SugarEnt-Full-12.0.1.
    I tried to install a fresh Sugar Enterprise 12.0.1 with demo data to verify other Sugar bugs in a local vm.
    Luckily I found additional log entries in php-fpm error log:

    PHP Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
    error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in /var/www/html/SugarEnt-Full-12.0.1/install/installSystemCheck.php on line 372
    PHP Warning: file_get_contents(): Failed to enable crypto in /var/www/html/SugarEnt-Full-12.0.1/install/installSystemCheck.php on line 372
    PHP Warning: file_get_contents(https://sugar-vm-deb-2/sugar-demo-12/itest.txt): failed to open stream: operation failed in /var/www/html/SugarEnt-Full-12.0.1/install/installSystemCheck.php on line 372


    It seems that one reason for ".htaccess rewrite failed" error is, when you try to install Sugar on a server with a self-signed certificate,  using https.
    Workaround: just use http:// instead of https:// for installation.