Dear all,

I'm currently having an issue with the file uploading for a few days. When I'm uploading a file through a normal form (adding content), I am receiving an HTTP error 500: "The server encountered an internal error or misconfiguration and was unable to complete your request."

This error appears also when I'm trying to save content on the panel interface when the image button is activated on the CKeditor. When I'm saving the content in plain text it is working but as soon as the CKeditor is activated and the image button to insert images on the toolbar then I receive this error 500.

The strangest thing I have noticed, is that when I'm creating an image field for a content type, in the field settings, I can upload a default image and this is WORKING! Whereas all the other places to upload images/files are not working...

The most frustrating thing is that I can't find any logs anywhere. I have enable them and there is nothing appearing on the server level nor in Drupal.

I'm posting this because I have already tried all suggested solutions and it is just not working. I explained myself, I have 2 webservers having the exact same php.ini and httpd.conf configuration. They also have the same php and mysql versions. I have copied the files and database of the non working instance (server A) into the server B and the file uploading just worked fine! Therefore I think this could come from the webserver in itself but they are configured the same. There is one last track I'm exploring now is the RPX proxy that we are having on the server A. But it looks just fine and we haven't changed anything, this issue just came out of nowhere without giving any logs.

Below is the list of things I have already tried:
- Followed these solutions https://www.drupal.org/node/416906
- Changing the .htaccess
- Changing the linux/se linux rights ownership
- Restart the apache, the network, the whole computer
- max_execution_time = 300
- memory_limit = 128M
- post_max_size = 100M

Please find below my configuration:
Drupal 7.54
centos-release-6-6.el6.centos.12.2.x86_64
compat-mysql51.x86_64 5.1.73-1.el6.remi @remi
mysql.x86_64 5.5.54-1.el6.remi @remi
mysql-libs.x86_64 5.5.54-1.el6.remi @remi
mysql-server.x86_64 5.5.54-1.el6.remi @remi
php55w-mysql.x86_64 5.5.38-1.w6 @webtatic
php-fedora-autoloader.noarch 0.2.1-2.el6 @epel
php-php-gettext.noarch 1.0.12-1.el6 @epel
php-tcpdf.noarch 6.2.13-1.el6 @epel
php-tcpdf-dejavu-sans-fonts.noarch 6.2.13-1.el6 @epel
php55w.x86_64 5.5.38-1.w6 @webtatic
php55w-bcmath.x86_64 5.5.38-1.w6 @webtatic
php55w-cli.x86_64 5.5.38-1.w6 @webtatic
php55w-common.x86_64 5.5.38-1.w6 @webtatic
php55w-gd.x86_64 5.5.38-1.w6 @webtatic
php55w-mbstring.x86_64 5.5.38-1.w6 @webtatic
php55w-mcrypt.x86_64 5.5.38-1.w6 @webtatic
php55w-opcache.x86_64 5.5.38-1.w6 @webtatic
php55w-pdo.x86_64 5.5.38-1.w6 @webtatic
php55w-process.x86_64 5.5.38-1.w6 @webtatic
php55w-tidy.x86_64 5.5.38-1.w6 @webtatic
php55w-xml.x86_64 5.5.38-1.w6 @webtatic
phpMyAdmin.noarch 4.0.10.18-1.el6 @epel

Many thanks in advance for your help.

I hope we could find a solution.

Best regards.

Comments

Jaypan’s picture

Have you looked at what the actual error is in the logs?

letrollpoilu’s picture

Yes and there are no entries in the error_log neither on the access_log neither in any other logs in the CentOs /var/log folder... below is my index.php

ini_set('display_errors', 'On');
ini_set('html_errors', 0);

// ----------------------------------------------------------------------------------------------------
// - Error Reporting
// ----------------------------------------------------------------------------------------------------
error_reporting(-1);

// ----------------------------------------------------------------------------------------------------
// - Shutdown Handler
// ----------------------------------------------------------------------------------------------------
function ShutdownHandler()
{
if(@is_array($error = @error_get_last()))
{
return(@call_user_func_array('ErrorHandler', $error));
};

return(TRUE);
};

register_shutdown_function('ShutdownHandler');

// ----------------------------------------------------------------------------------------------------
// - Error Handler
// ----------------------------------------------------------------------------------------------------
function ErrorHandler($type, $message, $file, $line)
{
$_ERRORS = Array(
0x0001 => 'E_ERROR',
0x0002 => 'E_WARNING',
0x0004 => 'E_PARSE',
0x0008 => 'E_NOTICE',
0x0010 => 'E_CORE_ERROR',
0x0020 => 'E_CORE_WARNING',
0x0040 => 'E_COMPILE_ERROR',
0x0080 => 'E_COMPILE_WARNING',
0x0100 => 'E_USER_ERROR',
0x0200 => 'E_USER_WARNING',
0x0400 => 'E_USER_NOTICE',
0x0800 => 'E_STRICT',
0x1000 => 'E_RECOVERABLE_ERROR',
0x2000 => 'E_DEPRECATED',
0x4000 => 'E_USER_DEPRECATED'
);

if(!@is_string($name = @array_search($type, @array_flip($_ERRORS))))
{
$name = 'E_UNKNOWN';
};

return(print(@sprintf("%s Error in file \xBB%s\xAB at line %d: %s\n", $name, @basename($file), $line, $message)));
};

$old_error_handler = set_error_handler("ErrorHandler");

Jaypan’s picture

If your server is not recording 500 errors, you need to configure your server to do so.

Trying to solve an error without knowing what the error is, is while not impossible, nearly so.

Unfortunately configuring your server is not a Drupal issue, so you'll first need to take care of that before we can help.

letrollpoilu’s picture

Dear Jaypan,

I have finally found out the issue today. It was indeed not Drupal related, we are using a reverse proxy which had its disk space completely full because of logs. Once the logs delete, the file uploading worked properly.

Thanks anyway for your help.