Error 500 (Internal Server Error) while uploading

Asked

Viewed 596 times

0

While trying to upload a txt file, I am receiving the erro 500.

I gave one # chmod -R 777 import to release all permissions.
ls -l from the folder where I am trying to save the file:

drwxrwxrwx 2 francisco francisco 4096 Dec 2 12:28 import

Man Yii is configured to use URL-Amigável:

'urlManager' => array(
    'urlFormat' => 'path',
    'rules' => array(
        '<controller:\w+>/<id:\d+>' => '<controller>/view',
        '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
        '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
    ),
),

And the Nginx also configured:

server {

    client_max_body_size 20M;

    listen 127.0.2.1:80;
    listen 192.168.25.33:80;
    root    /usr/share/nginx/meudominio.com;
    index index.php;

    server_name local.meudominio.com;

    location / {
        index index.php;
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ ^/(app|framework|themes/\w+/views){
        deny all;
    }

    location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
        try_files $uri =404;
    }

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }
}
  • 1

    Does the temporary folder have permission? normally it is the system folder (/tmp), but another can be defined in http://php.net/manual/ini.core.php#ini.upload-tmp-dir.

  • 1

    Another detail, if the error was in php/Yii would be displayed the default message (in the Yii layout). if the message is not displayed in the Yii layout then you can check the Nginx log: http://nginx.com/resources/admin-guide/logging-and-monitoring/

  • The temporary folder does have permission. I have actually fixed this problem, and I answered there at SOEN, but I did not want to answer here precisely to let others answer (and I am lazy). The error is actually PHP and a bit Nginx. The file size is limited in php.ini to 2M, although in Nginx it is 20MB (first line of the server). Just change upload_max_filesize to 20M and reset the service in my case php5-fpm.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.