Error 500 on CSS query

Status
Not open for further replies.

eltoni0

New Member
Messages
11
Reaction score
0
Points
0
Hi,

I've got a CSS included in all my pages headers. It's supposed to be generated from a PHP file.
Code:
<link rel="stylesheet" type="text/css" media="screen" href="http://www.thk-clan.co.cc/forums/extensions/pun_colored_usergroups/styles.css.php" />

However, that file doesn't generate any CSS but nginx generates an error 500 instead when queried.
Click here to load the file

Here is the code of the PHP file involved:
PHP:
<?php

header('Content-type: text/css; charset: UTF-8');
define('FORUM_ROOT', '../../');

require FORUM_ROOT.'include/essentials.php';
require_once FORUM_CACHE_DIR.'cache_pun_coloured_usergroups.php';

echo $pun_colored_usergroups_cache;

?>

The two required PHP files exist and can both be loaded (verified).
Any clue would be welcome. The answer is probably in server logs but I can't read then (can I ?)

Thank you in advance!
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Where is FORUM_CACHE_DIR defined?

Also, without knowing what is in the other two files, it is impossible to say. One of the included files might be the problem.
 
Last edited:

eltoni0

New Member
Messages
11
Reaction score
0
Points
0
No they're not, I have already checked that and the variables are well defined.

The problem apparently comes from nginx that doesn't execute PHP in my subdirectory public_html/forums/extensions/pun_colored_usergroups/.

To make sure of that, I have created a test file and placed it in the same subfolder :
PHP:
<?php
echo 'work';
?>
Same result, error 500. Have a look:
Test file in extension subdir
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Permissions on the file and the directories?
 

eltoni0

New Member
Messages
11
Reaction score
0
Points
0
I have double-checked :

extension directory (and subdirs) 0777
All files 0644

The upper folders are all in 755, 644 for all files.

It works on a test webserver of mine running Debian and a default apache2, with the same rights on folders and files of course.
 
Last edited:

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
No, but it is a best practice from a security standpoint (and arguably an essential in a shared hosting environment since it can help prevent cross-account shenanigans), and having it enforced at the meta level is a Good Thing™.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
And the servers actually run Apache, not nginx. nginx is the load-balancing front end.
 

eltoni0

New Member
Messages
11
Reaction score
0
Points
0
Thank you both for the information and support.

Ticket can now be closed.
 
Status
Not open for further replies.
Top