location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param DOCUMENT_ROOT /var/www/;
fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name;
fastcgi_param PATH_TRANSLATED /var/www$fastcgi_script_name;
include fastcgi_params;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort off;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
}
$qr_result = mysql_query($sql); //исправил
or die(mysql_error());
mysql_query("SET NAMES UTF8") or die('Не получилось выставить кодировку');
function exec_output( $cmd, $return_array = FALSE)
{
$console = array();
exec($cmd, $console);
if ( ! $return_array )
{
return implode(PHP_EOL, $console);
}
else {
return $console;
}
}
public function registerUser ( $data ) { // Обращаем внимание $data
/* от такого кода ничего не изменится
$this->prepareData($data);
$this->checkMail($data['email']);
$this->checkData($data);
*/
$this->createUser( $data ); // Обращаем внимание $data
}
public function registerUser ( $raw_data )
{
$data = $this->prepareData($raw_data);
if ( $this->checkMail($data['email']) && $this->checkData($data) )
{
$this->createUser( $data );
}
else
{
return FALSE;
}
}
try{
$a = 1;
$b = 0;
if ($b != 0){
echo $a/$b;
}
else {
throw new Exeption('Division by zero');
}
} catch(Exception $e){
echo 111;
}
class Test
{
public function __construct( & $app )
{
$this->app = $app;
}
}
$test = new Test( $app );
<?php
require_once 'Mobile_Detect.php';
$detect = new Mobile_Detect;
$is_mobile = $detect->isMobile();
$content = array();
while ( $res = mysql_fetch_assoc( $query_result ) )
{
$content[] = $res;
}
print_r($content);