« first day (1775 days earlier)      last day (3170 days later) » 

10:00 PM
nginx does not have .htacess files
 
your mean is :
9 mins ago, by tereško
@Sajad actually you should just change your $route = $_GET['rt']; to $route = $_SERVER['REQUEST_URI']; and it would work just fine
 
?
 
for fuck sake
could you PLEASE listen
 
ok
 
nginx does not have .htacess files
instead the url rewrites are done in configuration files, like your "localhost.conf"
try_files /index.html $uri @php;
this like tells nginx what to try executing (starting from right side)
the last thing there is index.html
that would basically be equivalent to .htacess file with
ErrorDocument 404 /index.html
 
10:03 PM
ah
 
@Sajad any questions so far?
 
1 question
I have some other .htaccess codes. for removing .php in url
how should I use them ?
 
what you want is probably something like this:
   fastcgi_param  SCRIPT_FILENAME   $document_root/index.php?rt=$args;
(I am guessing here)
 
it is a new language ?
 
it is a change for this line:
   fastcgi_param SCRIPT_FILENAME $document_root/index.php;
 
10:07 PM
ah
 
.. since you insist that you don't want to use $_SERVER['REQUEST_URI']
 
/me sleeps
 
@tereško so I replace it ?
 
10:11 PM
and what do you think?
 
:)
I fear of .conf files :)
done
 
you will have to restart nginx
otherwise the config does not take affect
(also, I am actually not sure if it will work)
 
ok
and I don't need to change $route = $_GET['rt']; to $route = $_SERVER['REQUEST_URI'];, right ?
 
yes
 
does not work !!!
shit
 
10:18 PM
nginx -s reload can be preferred over restarting.
 
did you try seeing what do you actually get?
 
:-)
 
did you try var_dumo($_ENV) or var_dump($_SERVER) ... or do you just say "doesnt work" and expect someone to magically fix it, @Sajad?
 
@RonniSkansing and the feature comparisons? ......you can make your code be a lot faster by not having any error checking....
 
none of those, good point. Glad you said something
You know those numbers can mess with the head
 
10:20 PM
@Sajad "doesn't work" is one of most useless assessments for any situation
 
The fact that it lists 'number of files' as a performance metric should be an indicator that the person doing those benchmarks....has something they're trying to prove.
 
@tereško I want to change $_GET['rt']; to $_SERVER['REQUEST_URI'];
 
no
 
there is any other solution ?
 
you should want to know why it didn't work
 
10:21 PM
how ?
 
try seeing what did you actually get sent to the php script
 
I write this var_dump($_SERVER) where ?
 
was the index.php file executed?
 
yes
 
if it was, what variable does it get?
 
10:23 PM
what ? my index.php is just containing <?php echo ''test"; ?>
 
when you see that something does not work, your first question should be "why"
 
@tereško ok
 
@Sajad if it only contains <?php echo ''test"; ?> then how do you know that it didn't work?
 
the output is : 'File not found.'
index.php does not open
 
2 mins ago, by tereško
was the index.php file executed?
2 mins ago, by Sajad
yes
 
10:25 PM
@tereško sorry, misunderstood
 
if file was not found, then you should go to nginx-error.log file and look at what is the last error
it should contain the name of the file that the script was looking for
 
ok, where was ngix-error.log ?
 
/var/log
 
ah ok
two lase lines:
2015/08/26 23:36:41 [error] 1488#0: *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 10.0.2.2, server: localhost
2015/08/26 23:36:42 [error] 1488#0: *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 10.0.2.2, server: localhost
 
what happens if you change the line back to: fastcgi_param SCRIPT_FILENAME $document_root/index.php;
 
10:29 PM
wait ...
 
do you still get the same error when accessing http://localhost/test/something
 
now, for all ULRs it says: File not found.
 
Anonymous
 
did you restart nginx?
 
1 sec - I will change it back and restart it again
 
Anonymous
10:33 PM
didn't nginx work yesterday?
 
@tereško can you give me that githhub link ? (localhost.conf)
there is not ctlr+z
I removed something
 
tnx
also in the terminam, why mark all + backspace does not work ?
should I remove all text character by character ?
 
ctrl+k deletes a line
ctrl+l pastes the previously deleted line
.. or was it other way around
 
ok
I restarted nginx
also I want to restart php
is it correct : service php-rpm restart
?
 
Anonymous
10:40 PM
fpm
 
ah !!
 
look at the service list if you want to know
 
:( still it does not work !
why I change it :((
 
21 mins ago, by tereško
@Sajad "doesn't work" is one of most useless assessments for any situation
 
ok
it is weird ! because it worked 30 min ago !
I need to check erro.log ?
 
10:44 PM
yes
and try accessing simple http://localhost and http://localhost/index.php
 
http://localhost/index.php woks
but http://localhost does not work
 
remove index.html from try_files line in the config
no ... that probably won't work
what exactly do you have in localhost.conf file?
 
    root /var/www;

    try_files $uri @php;

    location ~ .php$ {
        include fastcgi_params;
        fastcgi_pass unix:/var/run/php-fpm.socket;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
    location @php {
        include        fastcgi_params;
        fastcgi_pass   unix:/var
    }
}
 
What's with all the @s?
 
@PeeHaa me ?
 
10:52 PM
Yes
 
which line ?
actually I copy/pasted this
 
Both lines with @
What does it do?
 
@Sajad it should be
location @php {
    include        fastcgi_params;
    fastcgi_pass   unix:/var/run/php-fpm.socket;
    fastcgi_param SCRIPT_FILENAME $document_root/index.php;
}
@PeeHaa user-defined variables
 
@tereško oh yes ! I remember, we edited it already
 
@Sajad look at those lines
you are missing 1.5 lines there
 
10:55 PM
@tereško What's the use case of making index.php variable?
 
@PeeHaa because there are two behaviors
if php file exists: execute
if it doesn't: route it to index.php
 
sorry, but still does not work, here is my localhost.conf
server {
    listen   80;
    server_name localhost;

    root /var/www;

    try_files /index.html $uri @php;

    location ~ .php$ {
        include fastcgi_params;
        fastcgi_pass unix:/var/run/php-fpm.socket;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }

   location @php {
    include        fastcgi_params;
    fastcgi_pass   unix:/var/run/php-fpm.socket;
    fastcgi_param SCRIPT_FILENAME $document_root/index.php;
}
 
unclosed curly?
 
my nginx-error :
2015/08/27 00:12:38 [error] 1488#0: *44 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 10.0.2.2, server: localhos
2015/08/27 00:18:54 [emerg] 1649#0: unexpected end of file, expecting "}" in /usr/local/etc/nginx/sites-active/localhost.conf:20
2015/08/27 00:19:07 [error] 1488#0: *49 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 10.0.2.2, server: localhos
 
hoping someone knows this
In sql server 2016 what is the easiest way to import a 20gb sql database file?

sorry for asking here I cannot currently ask questions on the main site
 
11:01 PM
@Sajad your { and } are not matching
.. what's what the error says
 
@tereško my localhost.conf file has problem ?
 
2015/08/27 00:18:54 [emerg] 1649#0: unexpected end of file, expecting "}" in /usr/local/etc/nginx/sites-active/localhost.conf:20
 
I exactly cody/pasted your link
 
@Sajad see last two lines gist.github.com/teresko/…
 
ok
oh my God !
worked :)
 
11:05 PM
you are really bad at debugging
 
yes ! I will improve myself !
 
now try fastcgi_param SCRIPT_FILENAME $document_root/index.php?rt=$request_uri;
or , if that doesnt work:
fastcgi_param SCRIPT_FILENAME $document_root/index.php?rt={$request_uri};
 
I fear I change it and destroy all things ...
worked :P
 
Damn guys @Sajad and @tereško What are you guys doing..
 
we are configing nginx for MVC urls
 
11:10 PM
those are not "mvc urls"
 
anyway it will be ready for mvc !
 
you are hurting me
 
oh ! sorry
ok enough
go to sleep
 
mvc is architectural pattern, which defines constraints (limitations) for information exchange between application layers
 
oh i see..
 
11:12 PM
I know ! but I can not explain it like you ...
 
haha.. didnt want to hurt you @tereško ..I just went off my head.
I am gonna sleep now..mind blown.
Take care guys..
 
you want to say "clean urls"? @Sajad
 
yes, exactly
@tereško anyway thanks, now server is ready for uploading my website !
 
it should be
 

« first day (1775 days earlier)      last day (3170 days later) »