HTTP error 500

Status
Not open for further replies.

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
Posting the same question three times is NOT a good way of getting help.

The first thing you need to do is find out why your web server is returning the 500 response. The place to look is in:
/var/log/nginx/error.log you can also see what is happening in the access.log if you wish.

If you post the lines in the log that are relevant to the 500 response (use insert->code), then we may be able to diagnose it for you.
 

kiran870

New Member
Feb 4, 2019
13
0
1
37
Sorry @Adrian Fretwell for 3 times reposts please find the logs

Code:
2020/04/05 17:49:56 [error] 1706#0: *137 FastCGI sent in stderr: "PHP message: PHP Warning:  session_start(): open(/var/lib/php/session/sess_scdg30p2uv9c4hrifq1t9kqh14, O_RDWR) failed: Permission denied (13) in /var/www/fusionpbx/index.php on line 31
PHP message: PHP Warning:  session_start(): Failed to read session data: files (path: /var/lib/php/session) in /var/www/fusionpbx/index.php on line 31
PHP message: PHP Warning:  require_once(resources/require.php): failed to open stream: Permission denied in /var/www/fusionpbx/index.php on line 57
PHP message: PHP Fatal error:  require_once(): Failed opening required 'resources/require.php' (include_path='.:/usr/share/pear:/usr/share/php:/var/www/fusionpbx') in /var/www/fusionpbx/index.php on line 57" while reading response header from upstream, client: 1*.**.**.**, server: fusionpbx, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "1**.**.***.***"
 

ewdpb

Member
Oct 3, 2019
151
19
18
@kiran870 , you are getting a permission denied error to read the require.php file. By default that file should belong to the www-data user which should have read permissions. In fact the default permissions give read access to everyone. Have you modified those? Have a look to that file's permissions to start with, that should get you going.
 

kiran870

New Member
Feb 4, 2019
13
0
1
37
All i have done was clicked on schema upgrade at once after that the page went blank like this. can you please do provide me how to give the permissions am stucked up
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
Change directory to /var/www and then issue a recursive chown:
Code:
cd /var/www
chown -R www-data:www-data fusionpbx
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
OK, the assumption I made was that you would be using a fairly standard install on a Debian system. That is probably not the case. Please tell us about your system; what operating system and version, how did you install FusionPBX, what FusionPBX version etc. What user is Nginx running under, what user is FreeSWITCH running under.

The more information you can give, the better.
 

kiran870

New Member
Feb 4, 2019
13
0
1
37
@Adrian Fretwell please find the details

Static hostname: localhost.localdomain
Icon name: computer-vm
Chassis: vm
Machine ID: ************************************
Boot ID: *******************************************
Virtualization: vmware
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-1062.18.1.el7.x86_64
Architecture: x86-64
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
We need to find out what user the nginx process is running under. You can do this with the command ps aux
This is what it shows for nginx on my test box:
Code:
www-data  69333  0.0  0.0  71236 10328 ?        S    Mar15   0:45 nginx: worker process
www-data  69334  0.0  0.0  71148 10008 ?        S    Mar15   0:04 nginx: worker process
www-data  69335  0.0  0.0  70884  9560 ?        S    Mar15   0:00 nginx: worker process
www-data  69336  0.0  0.0  70876  8876 ?        S    Mar15   0:00 nginx: worker process
www-data  69337  0.0  0.0  70748  6496 ?        S    Mar15   0:00 nginx: worker process
www-data  69338  0.0  0.0  70748  6496 ?        S    Mar15   0:00 nginx: worker process
www-data  69339  0.0  0.0  70748  6496 ?        S    Mar15   0:00 nginx: worker process

As you can see the user is www-data. Find out what your user is and use that user name in the chown command we discussed earlier.

Also just for information, the fusion .php file permissions (not the ownership) can be restored with:
Code:
find /var/www/fusionpbx -type d -exec chmod 770 {} \;
find /var/www/fusionpbx -type f -exec chmod 664 {} \;
 
Status
Not open for further replies.