Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issues launching suitecrm locally #10146

Open
hodanf opened this issue Aug 28, 2023 · 6 comments
Open

issues launching suitecrm locally #10146

hodanf opened this issue Aug 28, 2023 · 6 comments
Labels
Area: Installation Issues & PRs related to the installation of the application Status:Requires Updates Issues & PRs which requires input or update from the author

Comments

@hodanf
Copy link

hodanf commented 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

@chris001
Copy link
Contributor

  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.

@johnM2401 johnM2401 added Status:Requires Updates Issues & PRs which requires input or update from the author Area: Installation Issues & PRs related to the installation of the application labels Aug 30, 2023
@johnM2401
Copy link
Contributor

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!

@Aakeeo
Copy link

Aakeeo commented 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
Copy link

Aakeeo commented 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);
}
}

@chris001
Copy link
Contributor

chris001 commented Feb 3, 2024

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

@pgorod
Copy link
Contributor

pgorod commented 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Installation Issues & PRs related to the installation of the application Status:Requires Updates Issues & PRs which requires input or update from the author
Projects
None yet
Development

No branches or pull requests

5 participants