issues launching suitecrm locally #5057

Open
opened 2026-02-20 16:28:52 -05:00 by deekerman · 7 comments
Owner

Originally created by @hodanf on GitHub (Aug 28, 2023).

Issue

I cannot launch suitecrm locally after cloning ht egithub repository. I am not sure if there is a requirements.txt document somewhere but when I tried to launch it, it is throwing the fwrite error below which seems to be from the suitecrm code itself

Expected Behavior

launch locally using localhost

Actual Behavior

PHP Fatal error: Uncaught TypeError: fwrite(): Argument #1 ($stream) must be of type resource, bool given in /home/*******/Desktop/SuiteCRM/install/install_utils.php:723

^will not launch locally with php -S localhost:8000 -t

Possible Fix

Unknown

Steps to Reproduce

clone github, launch locally with php -S localhost:8000 -t

Your Environment

Suitecrm Version (current github version)
PHP 8.2.9
MySQL 8.0.34-0ubuntu0.20.04.1
Google Chrome Version 116.0.5845.96

Originally created by @hodanf on GitHub (Aug 28, 2023). Issue I cannot launch suitecrm locally after cloning ht egithub repository. I am not sure if there is a requirements.txt document somewhere but when I tried to launch it, it is throwing the fwrite error below which seems to be from the suitecrm code itself Expected Behavior launch locally using localhost Actual Behavior PHP Fatal error: Uncaught TypeError: fwrite(): Argument #1 ($stream) must be of type resource, bool given in /home/*******/Desktop/SuiteCRM/install/install_utils.php:723 ^will not launch locally with php -S localhost:8000 -t Possible Fix Unknown Steps to Reproduce clone github, launch locally with php -S localhost:8000 -t Your Environment Suitecrm Version (current github version) PHP 8.2.9 MySQL 8.0.34-0ubuntu0.20.04.1 Google Chrome Version 116.0.5845.96
Author
Owner

@chris001 commented on GitHub (Aug 28, 2023):

  1. If composer isn't installed, you have to install it with:
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'e21205b207c3ff031906575712edab6f13eb0b361f2085f1f1237b7126d785e826a450292b6cfd1d64d92e6563bbde02') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer
  1. From the main directory of SuiteCRM, you have to run the command:
    composer install

  2. Browse to the web site of your SuiteCRM install. It should load and prompt you to login.

@chris001 commented on GitHub (Aug 28, 2023): 1. If `composer` isn't installed, you have to install it with: ``` php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('sha384', 'composer-setup.php') === 'e21205b207c3ff031906575712edab6f13eb0b361f2085f1f1237b7126d785e826a450292b6cfd1d64d92e6563bbde02') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" php composer-setup.php php -r "unlink('composer-setup.php');" sudo mv composer.phar /usr/local/bin/composer ``` 2. From the main directory of SuiteCRM, you have to run the command: `composer install` 3. Browse to the web site of your SuiteCRM install. It should load and prompt you to login.
Author
Owner

@johnM2401 commented on GitHub (Aug 30, 2023):

Hey!

Thanks for getting in touch!

On top of what @chris001 has noted, I would recommend ensuring your file/folder permissions are correct before installing.

As well as ensuring you meet the compatability matrix:
https://docs.suitecrm.com/admin/compatibility-matrix/

And have all the prerequisites noted here:
https://docs.suitecrm.com/admin/installation-guide/downloading-installing/#_recommended_installation_pre_requisites


If you're still having issues installing, could you try installing the version released yesterday? (7.14.0)
This version has a number of php8-related fixes, and should install when using php8.2.

Please let us know if you are having any further issues!

@johnM2401 commented on GitHub (Aug 30, 2023): Hey! Thanks for getting in touch! On top of what @chris001 has noted, I would recommend ensuring your file/folder permissions are correct before installing. As well as ensuring you meet the compatability matrix: https://docs.suitecrm.com/admin/compatibility-matrix/ And have all the prerequisites noted here: https://docs.suitecrm.com/admin/installation-guide/downloading-installing/#_recommended_installation_pre_requisites <br> If you're still having issues installing, could you try installing the version released yesterday? (7.14.0) This version has a number of php8-related fixes, and should install when using php8.2. Please let us know if you are having any further issues!
Author
Owner

@Aakeeo commented on GitHub (Oct 3, 2023):

It's mostly because the permissions are not correct for the SuiteCRM directory. If you give correct permissions. I will initialize a log file and this should work.

I too had the same issue... I am on Ubuntu.. All I did was
chmod -R 755
chown -R www-data: www-data <suitecrm_directory>

Please note that I have apache running as web server. Hence the user www-data

@Aakeeo commented on GitHub (Oct 3, 2023): It's mostly because the permissions are not correct for the SuiteCRM directory. If you give correct permissions. I will initialize a log file and this should work. I too had the same issue... I am on Ubuntu.. All I did was chmod -R 755 <suitecrm-directory> chown -R www-data: www-data <suitecrm_directory> Please note that I have apache running as web server. Hence the user www-data
Author
Owner

@Aakeeo commented on GitHub (Feb 3, 2024):

The issue here is on the line 732 in install/install_utils.php . You can change the code from

if (@fwrite($fp, $nl.$entry) === false) {
$GLOBALS['log']->fatal('could not write to install.log: '.$entry);
}

to

if(is_resource($fp)){
if (@fwrite($fp, $nl.$entry) === false) {
$GLOBALS['log']->fatal('could not write to install.log: '.$entry);
}
}

@Aakeeo commented on GitHub (Feb 3, 2024): The issue here is on the line 732 in install/install_utils.php . You can change the code from if (@fwrite($fp, $nl.$entry) === false) { $GLOBALS['log']->fatal('could not write to install.log: '.$entry); } to if(is_resource($fp)){ if (@fwrite($fp, $nl.$entry) === false) { $GLOBALS['log']->fatal('could not write to install.log: '.$entry); } }
Author
Owner

@chris001 commented on GitHub (Feb 3, 2024):

@Aakeeo Can you make a Pull Request with your fix?

@chris001 commented on GitHub (Feb 3, 2024): @Aakeeo Can you make a Pull Request with your fix?
Author
Owner

@pgorod commented on GitHub (Feb 3, 2024):

May I suggest something different?

The proposed code will not be useful to users because if you neglected to set proper permissions and the log file can't be written to, you won't know what happened, you will be left without a clue.

On the other hand, it is difficult to write a helpful message to the log file, if you can't write to the log file...

So I propose this trick: change the $fp variable name to $ifYoureSeeingAFatalErrorHereThenYouMustCheckPermsWritingToLogFile

... and leave the current code as it is. If it bombs, if bombs telling you why.

@pgorod commented on GitHub (Feb 3, 2024): May I suggest something different? The proposed code will not be useful to users because if you neglected to set proper permissions and the log file can't be written to, you won't know what happened, you will be left without a clue. On the other hand, it is difficult to write a helpful message to the log file, if you can't write to the log file... So I propose this trick: change the **`$fp`** variable name to **`$ifYoureSeeingAFatalErrorHereThenYouMustCheckPermsWritingToLogFile`** ... and leave the current code as it is. If it bombs, if bombs telling you why.
Author
Owner

@serhiisamko091184 commented on GitHub (Oct 7, 2024):

Hello @hodanf,

The issue has been marked as stale because there has been no recent activity. It will be closed if no further activity occurs.
Thanks for your contributions.

Regards,
Serhii

@serhiisamko091184 commented on GitHub (Oct 7, 2024): Hello @hodanf, The issue has been marked as stale because there has been no recent activity. It will be closed if no further activity occurs. Thanks for your contributions. Regards, Serhii
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#5057
No description provided.