Fatal error when trying to install SS 4.2.1

silverstripe-4
Tags: #<Tag:0x00007f0828745d60>

#1

Silverstripe Version: 4.2.1
PHP version: 7.1.23
MySQL version: 5.5.61

Hello,
I am trying to install SS 4.2.1 onto my server but I am receiving the following error on the ‘Installing Silverstripe…’ screen

I am now running through the installation steps (this should take about 30 seconds)

If you receive a fatal error, refresh this page to continue the installation

* Setting up public/index.php
* Setting up app/_config.php
* Setting up app/_config/theme.yml
* Setting up .env
* Setting up public/.htaccess

**Fatal error** : Uncaught Error: Call to undefined function SilverStripe\Core\mb_regex_encoding() in /home/xxxxx/public_html/xxxxx/vendor/silverstripe/framework/src/Core/CoreKernel.php:465 Stack trace: #0 /home/xxxxx/public_html/xxxxx/vendor/silverstripe/framework/src/Core/CoreKernel.php(189): SilverStripe\Core\CoreKernel-&gt;bootPHP() #1 /home/xxxxx/public_html/xxxxx/vendor/silverstripe/framework/src/Control/HTTPApplication.php(65): SilverStripe\Core\CoreKernel-&gt;boot(true) #2 /home/xxxxx/public_html/xxxxx/vendor/silverstripe/framework/src/Control/Middleware/HTTPMiddlewareAware.php(65): SilverStripe\Control\HTTPApplication-&gt;SilverStripe\Control\{closure}(Object(SilverStripe\Control\HTTPRequest)) #3 /home/xxxxx/public_html/xxxxx/vendor/silverstripe/framework/src/Control/HTTPApplication.php(67): SilverStripe\Control\HTTPApplication-&gt;callMiddleware(Object(SilverStripe\Control\HTTPRequest), Object(Closure in  **/home/xxxxx/public_html/xxxxx/vendor/silverstripe/framework/src/Core/CoreKernel.php**  on line  **465**

How am I able to resolve this?

Thanks for your help.


#2

OK, so this isn’t an answer because I still have issues.
Originally I tried installing by uploading a ZIP file and extracting it, I have now attempted with Composer but this time I am getting;

I am now running through the installation steps (this should take about 30 seconds)
If you receive a fatal error, refresh this page to continue the installation
* Setting up public/index.php
* Setting up app/_config.php
* Setting up app/_config/theme.yml
* Setting up .env
* Setting up public/.htaccess
* Building database schema...
* Creating default CMS admin account...
* Checking that friendly URLs work...
* Friendly URLs are not working. This is most likely because a rewrite module isn't configured correctly on your site. You may need to get your web host or server administrator to do this for you:
   **mod_rewrite  or other rewrite module is enabled on your web server
   **AllowOverride All**  is set for the directory where SilverStripe is installed

I changed the permissions of the index.php file, in the public directory, from 755 to 644 and refreshed the install page but all this does is reset the permission on the index.php file back to 755.

Has anyone come across this before or know of a solution?

Thanks


#3

Hi. I have a similar probleme witth you . Do you found issue about that. If yes please share it: Thanks.
My installation stop at:
I am now running through the installation steps (this should take about 30 seconds)

If you receive a fatal error, refresh this page to continue the installation

Setting up public/index.php
Setting up app/_config.php
Setting up app/_config/theme.yml
Setting up .env
Setting up public/.htaccess
Building database schema…
ERROR [Emergency]: Uncaught SilverStripe\ORM\Connect\DatabaseException: Couldn’t run query: SHOW DATABASES LIKE ‘skyran_group_com_skyran_skg’ Access denied; you need (at least one of) the SHOW DATABASES privilege(s) for this operation IN POST /install.php Line 64 in /customers/7/6/1/skyran-group.com/httpd.www/vendor/silverstripe/framework/src/ORM/Connect/DBConnector.php Source ====== 55:

Please help


#4

Your error isn’t the same as the original poster. The answer to your issue is in the error message :slight_smile:
It doesn’t look the like database user you are using has sufficient privileges for the install. You’ll need to contact your host and ask them to adjust things accordingly.


#5

OK. Thanks. I will contact them.


#6

OK, so I am still having issues.
From what I can tell, when SS tries to install, it changes the permissions of .env, public/.htaccess and public/index.php from 644 to 775. If I change the permission back to 644 and then refresh the page SS changes the permissions back to 775 on the files. When the permissions are changed the server throws the following error;
[:error] [pid 616435:tid 47597298845440] [client xxx.xx.xx.xx:19118] SoftException in Application.cpp:261: File “xxxx/public/index.php” is writeable by group, referer: https://xxxx.net.au/install.php

Our server uses suPHP, so incorrect permissions cause errors, and the installation seems to keep setting incorrect permissions of 775 when it should be setting 644.

Am I able to change the permission settings somewhere in the install script?

Thanks for your help.


#7

You might find it simpler to avoid using the installer with suPHP - it’s very picky about what it will allow!

If you reset the file permissions, and manually create the .env file (there’s an example in the code), you should be able to run a dev/build and have a working system without the need to run the installer.


#8

waoooh i think that I fix the issue for my probleme :
**

Uncaught SilverStripe\ORM\Connect\DatabaseException: Couldn’t run query: SHOW DATABASES LIKE ‘skyran_group_com_skyran_skg’ Access denied; you need (at least one of) the SHOW DATABASES privilege(s) for this operation

**
I acced to vendor/silverstripe/framework/src/ORM/Connect/Database.php
and change private static $optimistic_connect = false; on true

/

 * In cases where your environment does not have 'SHOW DATABASES' permission,
 * you can set this to true. Then selectDatabase() will always connect without
 * doing databaseExists() check.
 *
 * @var bool
 */
// private static $optimistic_connect = false;
private static $optimistic_connect = true;

and everything is work for me now.
Thanks God.


#9

@DorsetDigital Thank you very much, this solution worked!

I also added SS_ENVIRONMENT_TYPE=“dev” to the .env file.

The SS4 Slack channel mentioned something similar around the same time you did, I really hope this helps someone in the future.

Thanks again.