Yetiforcecrm: When we Migrate to another server We get Session error

Created on 24 Mar 2019  Β·  10Comments  Β·  Source: YetiForceCompany/YetiForceCRM

🐞 bug report

⁉️ Describe the bug


I moved my data from old server(php7.1.16) to another server and in new server the PHP is 7.1.27) and now i get error , some error like permission
and now i can not get to login page at all.

πŸ”₯ How to trigger the error

Steps to reproduce the behavior:

  1. Go to 'new webpage'
  2. Check for the domain name for CRM which is in config.inc.php file
  3. refresh the page , restart the apache, change the permissions to 777. and again reload the page
  4. See error

πŸ‘Ž Actual Behavior

Warning: SessionHandler::read(): open(/var/www/html/mycrm/cache/session/sess_nhj9g6e45fkml4bsbgrnirai34, O_RDWR) failed: Permission denied (13) in /var/www/html/mycrm/vendor/yetiforce/Session.php on line 32

Warning: session_start(): Failed to read session data: user (path: /var/www/html/mycrm/cache/session) in /var/www/html/mycrm/vendor/yetiforce/Session.php on line 32

Warning: mkdir(): Permission denied in /var/www/html/mycrm/include/runtime/Viewer.php on line 65

Warning: file_put_contents(/var/www/html/mycrm/include/runtime/../../cache/logs/viewer-debug.log): failed to open stream: No such file or directory in /var/www/html/mycrm/include/runtime/Viewer.php on line 34

Warning: mkdir(): Permission denied in /var/www/html/mycrm/include/runtime/Viewer.php on line 65

Warning: file_put_contents(/var/www/html/mycrm/include/runtime/../../cache/logs/viewer-debug.log): failed to open stream: No such file or directory in /var/www/html/mycrm/include/runtime/Viewer.php on line 34

Warning: file_put_contents(/var/www/html/mycrm/include/runtime/../../cache/logs/viewer-debug.log): failed to open stream: No such file or directory in /var/www/html/mycrm/include/runtime/Viewer.php on line 34

Fatal error: Uncaught --> Smarty: unable to write file /var/www/html/mycrm/cache/templates_c/basic/wrt5c97f2424aaa76_49901395 <-- thrown in /var/www/html/mycrm/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_writefile.php on line 49

Warning: fopen(/var/www/html/mycrm/cache/logs/system.log): failed to open stream: No such file or directory in /var/www/html/mycrm/vendor/yetiforce/Log/FileTarget.php on line 62

πŸ‘ Expected Behavior


I expect the login page to come up

πŸ“ PHP/Apache/Nginx/Browser/CRM Logs

🌍 Your Environment


| Environment | Version / Name |
| ---------------- | -------------- |
| YetiForce | 4.3.0
| Web server (name and version)| apache2 |
| PHP | 7.1.27 |
| Browser (name and version) | chrome |
| Operating System (name and version) | CentOS 7 |
| Database (name and version) | mysqld |

❓ Additional context

Add any other context about the problem here.

❔ question

Most helpful comment

sudo chcon -t httpd_sys_content_t /var/www/html/ -R
sudo chcon -t httpd_sys_rw_content_t /var/www/html/ -R

SOLUTION FOUND, THANKS EVERYONE

All 10 comments

you have a problem with file permissions, check if you have the correct file owner

i made all file owners to apache:apache as i found in php file

?php echo whoami;

@mjapple maybe should be www-data:www-data?

i will try now

i moved everything to html folder
find /var/www/html/ -type d -exec chown www-data:www-data {} \;
find /var/www/html/ -type f -exec chown www-data:www-data {} \;

I applied these two,
OMG i received so many chown: invalid user: β€˜www-data:www-data’...

When the crm was on my mac it was _www:_www

I will try to change the httpd.conf sudo nano /etc/httpd/conf/httpd.conf

and change the the user and group to _www , this alone did not work as well

Using nano /etc/php-fpm.d/www.conf

i changed also to get the below codes in the conf file
listen.owner = _www listen.group = _www

; RPM: apache Choosed to be able to access some dir as httpd user = _www ; RPM: Keep a group allowed to write in log dir. group = _www

and I believe the www-data is for ubuntu or debian, while i am using CentOS 7

@mjapple google confirm what user:group should be apache:apache for CentOS 7. Maybe chmod command will help you?

i disabled the debug now some of the errors are gone

Only three errors left i will consult with VPS admin

Warning: SessionHandler::read(): open(/var/www/html/cache/session/sess_lhebp8lqoafvpuh6ucjls6nndi, O_RDWR) failed: Permission denied (13) in /var/www/html/vendor/yetiforce/Session.php on line 32

Warning: session_start(): Failed to read session data: user (path: /var/www/html/cache/session) in /var/www/html/vendor/yetiforce/Session.php on line 32

Fatal error: Uncaught --> Smarty: unable to write file /var/www/html/cache/templates_c/basic/wrt5c99f1c4bdd2c2_27553264 <-- thrown in /var/www/html/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_writefile.php on line 49

sudo chcon -t httpd_sys_content_t /var/www/html/ -R
sudo chcon -t httpd_sys_rw_content_t /var/www/html/ -R

SOLUTION FOUND, THANKS EVERYONE

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MacarenaReina picture MacarenaReina  Β·  3Comments

rskrzypczak picture rskrzypczak  Β·  3Comments

serbiaserbia picture serbiaserbia  Β·  3Comments

michelmarquesrj picture michelmarquesrj  Β·  3Comments

canomogollon picture canomogollon  Β·  3Comments