A
A
Alexander Fanamurov2015-10-19 06:19:54
PHP
Alexander Fanamurov, 2015-10-19 06:19:54

Kohana + nginx. The script does not find the called classes?

There is a debugged project in php, it works on locale and regular hosting. An instance was set up on digital ocean (ubuntu 14.04 + php-fpm 5.5.9 + nginx
Configured by: help.ubuntu.ru/wiki/nginx-phpfpm
My config

server
{
  listen 80;
  server_name 	XXXX;
  root			/var/www/XXXX;
  index			index.php index.html index.htm;
  client_max_body_size		200m;	# увеличение максимального объема файла для загрузки до 200МБ
  # Buffers
  fastcgi_buffers 64 4K;

  # include common/upstream;
  include common/security;
  include common/gzip;

  location / { 
    if (!-e $request_filename) { rewrite ^(.*)$ /index.php; } 
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-for $remote_addr;
    proxy_set_header Host $host;
  }

  # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        location ~ \.php$ {
        		include fastcgi_params;
        		root /var/www/XXXX;
        		index		index.php;
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_split_path_info			^(.+?\.php)(/.*)?$;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param	PATH_TRANSLATED		$document_root$fastcgi_script_name;
                fastcgi_param	SERVER_ADMIN		[email protected];
        fastcgi_param	SERVER_SIGNATURE	nginx/$nginx_version;
        set		$path_info		$fastcgi_path_info;
        fastcgi_param	PATH_INFO		$path_info;

        }

  location ~* \.(jpg|jpeg|gif|png|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|tar|wav|bmp|rtf|swf|ico|flv|txt|xml|docx|xlsx)$ {
    root /var/www/XXXX;
    index index.html index.php;
    access_log off;
    expires 30d;
  }

  location ~* ^/(?:modules|system)\b.* {
        	#rewrite ^(.+)$ /index.php$1 permanent;
    	}

  location ~ /\.ht {
    deny all;
  }
}

In server error.log:
2015/10/18 21:27:18 [error] 3293#0: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Class 'Rocket_Model_Apps' not found in /var/www/martds.ru/modules/rocket3/classes/Rocket/Helper.php on line 24" while reading response header from upstream, client: 46.8.132.98, server: martds.ru, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "188.166.65.233"

The stacktrace looks like this:
MODPATH/rocket3/init.php [104]
Cache::$default = Rocket_Helper::config('main', 'cache', 'file');
MODPATH/rocket3/classes/Rocket/Helper.php [ 24 ]
$Model_Apps = new Rocket_Model_Apps();
Here the class cannot be found
===
I changed the nginx config to one that works exactly on another project (only there ubuntu 12.04), the result is the same

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Fanamurov, 2015-10-29
@Fanamura

Problem solved.
On Digital Ocean on Ubuntu 14.04 + php 5.5.9 in php.ini is:
php_short_tag = 0;
Need to change to
php_short_tag = 1;

A
Alexey Skobkin, 2015-10-19
@skobkin

Of course, I have no idea how Kohana works there, but you have cache-related swearing there. Have you tried clearing the cache and at the same time checking access to its directory?
It is quite possible that an analogue of the Composer class map is being generated, but the paths in it have been preserved from the localhost.

L
LeMaX, 2015-10-29
@LeMaX

What version of kohana?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question