On install SuiteCRM 7.12 ESR -> PHP Fatal error

I downloaded SuiteCRM 7.12 ESR. Unzipped it. Browse to URL and get blank page

<html>
<head></head>
<body></body>
</html>

errorl.log
[Mon Nov 08 15:13:59.587542 2021] [php:error] [pid 92663] [client 127.0.0.1:42470] PHP Fatal error: Uncaught TypeError: fwrite(): Argument #1 ($stream) must be of type resource, bool given in /var/www/tuf/install/install_utils.php:723\nStack trace:\n#0 /var/www/tuf/install/install_utils.php(723): fwrite()\n#1 /var/www/tuf/install/install_utils.php(64): installLog()\n#2 /var/www/tuf/install.php(826): installerHook()\n#3 {main}\n thrown in /var/www/tuf/install/install_utils.php on line 723

Apache 2.4
php 8

There is no useful information in the installation guide.

Please advise how to resolve this error.

Thank you.

Use php 7.4

I changed to php 7.4

It doesn’t help.

error.log
[Tue Nov 09 09:56:39.005447 2021] [proxy_fcgi:error] [pid 85715] [client 127.0.0.1:44068] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Exception: SuiteCRM is not installed. Entry point needs an installed SuiteCRM, please install first. in /var/www/tuf/include/entryPoint.php:59\nStack trace:\n#0 /var/www/tuf/index.php(47): require_once()\n#1 {main}\n thrown in /var/www/tuf/include/entryPoint.php on line 59' [Tue Nov 09 09:56:39.023754 2021] [proxy_fcgi:error] [pid 85715] [client 127.0.0.1:44068] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught TypeError: fwrite(): Argument #1 ($stream) must be of type resource, bool given in /var/www/tuf/install/install_utils.php:723\nStack trace:\n#0 /var/www/tuf/install/install_utils.php(723): fwrite()\n#1 /var/www/tuf/install/install_utils.php(64): installLog()\n#2 /var/www/tuf/install.php(826): installerHook()\n#3 {main}\n thrown in /var/www/tuf/install/install_utils.php on line 723'

Please advise how to resolve this error.

Thank you.

I did look at it. It doesn’t have any usefull information.

But you managed to slide in some commercial for your company. :frowning:

Sorry about that. If you feel posts aren’t helpful and go beyond what you would expect to be reasonable behavior then please use the flag function and we moderators can swoop in and help. :slight_smile:

Now in regards to your issues. I had a quick look around and folk (outside of SuiteCRM) state that it could be an issue with composer. Do you get this issue also after updating composer?

Thank you @samus-aran for replying.

I was looking at that flag button, but I didn’t know what does it do. Yes, it flags it, but what that means - what will happen? Will there be a flag and only I will be able to see it? So I didn’t flag the reply. Now I know what it does. :slight_smile:

I don’t understand your reply. I’ve just unzipped the SuiteCRM. I can’t install it. I get blank web page.

What does the composer do with the installation?

I have composer 2.1.12

follow the install instructions here.

you would need composer v1, as per Composer install errors - #5 by MadMart

when you extract the files in a folder, you should run

composer install --no-dev

Yes, I was folowing the install guide

After I visited http:////install.php I get blank page.

First attempt was with NO composed on server. Then I installed the composed. It still didn’t work.

I get blank page launching …/install.php

Okay,

So, lets revise the environment after you’ve made changes:

You have:
7.12.0 SuiteCRM (is this the installer package from downloads page? or a GitHub repo pull i.e. cloning from the repo)
PHP 7.4
Composer v1
Apache 2.4

What are your error.logs saying now?

Current setup
SuiteCRM from https://suitecrm.com/files/147/SuiteCRM-7.12/573/SuiteCRM-7.12.0.zip
Apache 2.4
php 7.4
composer 2.1.12

error.log
[Wed Nov 10 13:14:32.802230 2021] [proxy_fcgi:error] [pid 973] [client 127.0.0.1:50978] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught TypeError: fwrite(): Argument #1 ($stream) must be of type resource, bool given in /var/www/tuf/install/install_utils.php:723\nStack trace:\n#0 /var/www/tuf/install/install_utils.php(723): fwrite()\n#1 /var/www/tuf/install/install_utils.php(64): installLog()\n#2 /var/www/tuf/install.php(826): installerHook()\n#3 {main}\n thrown in /var/www/tuf/install/install_utils.php on line 723' [Wed Nov 10 13:14:34.986933 2021] [proxy_fcgi:error] [pid 975] [client 127.0.0.1:50980] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught TypeError: fwrite(): Argument #1 ($stream) must be of type resource, bool given in /var/www/tuf/install/install_utils.php:723\nStack trace:\n#0 /var/www/tuf/install/install_utils.php(723): fwrite()\n#1 /var/www/tuf/install/install_utils.php(64): installLog()\n#2 /var/www/tuf/install.php(826): installerHook()\n#3 {main}\n thrown in /var/www/tuf/install/install_utils.php on line 723'

Check ownership and permissions to ensure your web server has access to write to install.log

1 Like

I did several test of SuiteCRM. Build the server from ground up (installing the OS, …) and then installing the SuiteCRM. Apparently in this test I’ve forgot to set/check the parmissions. :flushed: :disappointed:

@pgr Composer version should also be added to Compatibility Matrix

1 Like

Dear @pgr and @Cadej ,

I have the exact same issue. I am trying to install SuiteCRM 7.12.6 from the official site. My server has Plesk Obsidian v18.0.45 running over Ubuntu 20.04.4 LTS, with Apache version 2.4.41 and PHP version 8.0.21.

I am following the instructions provided on the official site. I uploaded the installation files to a folder within the file system for one of the Plesk subscriptions (I already have a Wordpress website running for this subscription, so the SSL certificate is already installed and all http requests are turned into https, just so you know in case this could be an issue).

After doing only the abovementioned, the install.php file loaded up the first step page in the browser (via https), but after trying to begin the installation, it didn’t work (as expected) and loaded a blank page. I then executed the sudo commands using the SHH terminal to change the owner to the Apache user www-data and set permissions. After that, the install.php file will load just a blank page.

I then go to the log and I can see a 500 error:

|2022-07-27 03:41:21|Error|XX-XXX-XX-XX||AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught TypeError: fwrite(): Argument #1 ($stream) must be of type resource, bool given in ~/suitecrm/install/install_utils.php:723\nStack trace:\n#0 ~/suitecrm/install/install_utils.php(723): fwrite()\n#1 ~/suitecrm/install/install_utils.php(64): installLog()\n#2 ~/suitecrm/install.php(826): installerHook()\n#3 {main}\n thrown in ~/install/install_utils.php on line 723’|

I have proceeded as suggested on this thread:

  1. Check ownership and permissions to ensure my web server has access to write to ‘install.log’:

I am completely new to Linux, but I checked the permissions for this file as shown in the file manager in Plesk and with the ‘ls -l’ command (since the ‘ll’ command does not work), and these are ‘rwx r-x r-x’ (which I learned is 755) and the owner is user ‘www-data’ in the group ‘www-data’. I understand, then, that this is what we would expect after using the previous sudo command for all the files in the folder, right? So, considering this, can we be sure that the web server can write into the file or is there anything else that I would need to do?

As per the log, I have the feeling that Apache allowed visitors to read the file but when the file started to want to write in the log, a writing error happens. But why?

  1. Install Composer.

When I install it using the command ‘composer install --no-dev’, I get:

Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove

In JsonFile.php line 181:

file_put_contents ~/suitecrm/vendor/composer/installed.json: Failed to open stream: Permission denied

Anyway, I later checked and Plesk already comes with Composer v2 installed as an extension. So probably this is not the issue.

Maybe this could be an issue related to my current .htaccess file? Here is what I have in it:


RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^(.)$ https://%{HTTP_HOST}/$1 [R=301,L]*


RewriteEngine On
RewriteRule . - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]*
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

ErrorDocument 404 /index.php?error=404

I would really appreciate some help, could you guys help me out please?

Have a good one,

Javier

Please run this command and tell us which user name it gives:

ps -ef | egrep '(httpd|apache2|apache)' | grep -v whoami | grep -v root | head -n1 | awk '{print $1}'

That should be the user name you use for the chown.

Also , check if you have something called SELinux turned on (Google to learn how to check). If it’s on, it needs proper configuration, or else it might interfere.

Dear @pgr,

Many thanks for your response and time.

The user name shown after executing your proposed command in the terminal, is ‘www-data’, as expected. And that is the name I used for the chown.

I executed ‘getenforce’ and ‘sestatus’ and it says that I don’t have SELinux installed. I do have the Plesk firewall and my hosting provider’s firewall set up so that only specific ports (and sometimes even only my IP) are allowed.

I am thinking, that maybe the issue is produced by Plesk and the way it creates the directory structure, plus the way that Apache then accesses this structure and the permissions that Apache can have over it. So, perhaps even if the ‘suitecrm’ folder I created is owned by ‘www-data’ and the files inside it have writing permissions, but this ‘suitecrm’ folder is inside the folder structure assigned (and exclusive) to one of the Plesk subscriptions (a subscription is basically a user), and even if Apache can serve the website and write into the website files within this folder structure that are owned by the user, it may not be able to write into the suitecrm files within the same folder structure that are owned by www-data. Would that make sense at all? I wonder if other Plesk users tried to install SuiteCRM and had a similar issue or could provide with a workaround.

Also, I can see that websites are usually placed in the httpdocs folder of Plesk, but I did not do that and placed the website (and the suitecrm folder in it) in the parent directory of the Plesk subscription. The website works fine, because you can choose the folder to which the domain shall point to, but I am unsure if this could be creating an issue to Suite CRM.

Another idea that I have: I have seen in the official installation guide for v8 and in other v7 installation guides I found on the internet, that the creation of a vhost is needed. In the case of v8, in order not to have all contents of the root SuiteCRM folder open to the internet; while in the case of v7, it seems to me that it is to be able to have a subdomain (for example crm.mydomain.com) pointing to the /suitecrm/ folder. I wonder if this would be needed to bypass any writing limitations as described above?

I think I am going to try installing v8 instead, and see how it goes and if I learn something new that could help me install v7 in case I need to :slight_smile:

Cheers,

Javier

I wouldn’t go for v8 yet, if I were you. I think you will face all the same problems, and then some more.

There’s something else you can check, which is the SetUID and SetGID bits on the directories. These will influence the ownership and permissions of new files created.

If you split the chmod commands for directories and files, you can use the magic “2” that addresses this issue:

find . -type d -exec chmod 2755 {} \;
find . -type f -exec chmod 0644 {} \;

Hi @pgr,

Would you be so kind to check my post with my experience trying to install v8?

I believe there is an issue with Composer and Symfony, it doesn’t look to be an issue with permissions. I tried different combinations of permissions and, as said on my post, even giving ALL permissions to all users, the errors related to Composer and Symphony won’t go away…

Best regards,

Javier