« first day (1774 days earlier)      last day (3184 days later) » 

8:00 PM
502 Bad Gateway | nginx !
 
hmm ..
 
@tereško what is "pwd" ?
 
Anonymous
^ current directory
 
^ that
but I don't know what it's acronym for exactly
 
Anonymous
p(something) working directory ? :)
 
Anonymous
8:01 PM
too lazy to google :/
 
@tereško ok, why .php does not work ?
 
maybe
 
Anonymous
add
 
print working dir :p
 
print working directory
 
Anonymous
8:01 PM
index index.html index.htm index.php;
 
Anonymous
in server block @Sajad
 
try looking in /var/log/nginx-error.php , it should tell you what happened (think it is the rewrite rule that failed)
 
@samaYo I need to edit my configs ?
 
@samaYo this is his current config file: gist.github.com/teresko/d5217db617732c4565b4
 
8:03 PM
@tereško why my config file is very small ?
 
Anonymous
@Sajad yes, alter the config the server{} block and add that line
 
@samaYo ok
 
@Sajad I think I know the reason for 502 error
 
@tereško what is its problem ?
 
1 sec, let me doublecheck
 
8:05 PM
pwd -P - print working directory - Print it really :)
 
@tereško ok
 
ok, got it
 
what is it ??
 
go to file /usr/local/etc/php-fpm.conf
and scroll to line 164
 
as root ?
 
8:08 PM
imgur.com/gallery/XHDlvDR my current situation
 
yes, as root
 
Anonymous
@AnmolRaghuvanshi which one ?
 
@tereško so ?
 
@Sajad that line says "listen = 127.0.0.1:9000"
 
^ above link @samaYo
 
8:09 PM
right?
 
right
 
change it to listen=/var/run/php-fpm.socket
and then restart php-fpm service
 
I remove that Ip?
 
yes
 
Anonymous
/me does not likes sockets Ports rule \0/
 
8:11 PM
@samaYo I dont like to go through tcp/ip stack (even though it is faster than on linux )
 
@tereško so ?
 
did you save the file and restart php-fpm service?
 
@tereško which one is faster ??? I want the faster
 
so ...
I am experimenting ...
 
@Sajad "tcp/ip stack" refers just to a small part of kernel, which deals with networking. I do not make claims regarding entire operating systems.
 
8:13 PM
@JoeWatkins seven eleven?
 
I'll show you some code and ask some questions, gimme the first obvious answers without thinking about it too much ... ready ?
 
@tereško ok
 
so .. done everything?
 
Anonymous
@Sajad General rule, when you edit a config file you should usually restart the daemon or the service relating to that config file, so you don't have to wait until people tell you to restart it.
 
refresh the browser?
@JoeWatkins you are too old to do strange drugs
 
8:14 PM
@tereško still 502 bad Gateway
 
@Sajad did you restart php-fpm?
 
yes
service php-fpm restart
 
and you changed that line from "isten = 127.0.0.1:9000" to "listen=/var/run/php-fpm.socket"
right?
 
right
 
try restarting nginx too, just in case
 
8:16 PM
still 502 Bad Gateway
 
hmm .. there is something still missing
 
Anonymous
check the logs
 
try opening http://localhost/index.php
and check /var/log/nginx-error.log as @samaYo suggests
 
Anonymous
tail /var/log/nginx/error.log
 
Anonymous
and give us the result
 
8:17 PM
(you should be able to copy stuff, if you select text with mouse in putty)
 
<?php
$threaded = new Threaded();
while ($i++<10)
	$threaded[] = $i;

$thread = new class($threaded) extends Thread {

	public function __construct($threaded) {
		$this->threaded = $threaded;
	}

	public function run() {

		$this->threaded->synchronized(function(){
			while (!$this->threaded->ready) {
				$this->threaded->wait();
			}

			unset($this->threaded[2]);
			unset($this->threaded[3]);
			unset($this->threaded[4]);
			unset($this->threaded[5]);
		});
	}

	private $threaded;
};

$thread->start();
sorry for wall of code
questions, is the output for both bits predictable, do you understand what is going on ? and a follow up question depending on your answers ...
 
2015/08/25 20:01:13 [crit] 1613#0: *4 connect() to unix:/var/run/php-fpm.socket
2015/08/25 20:04:41 [crit] 1613#0: *8 connect() to unix:/var/run/php-fpm.socket
2015/08/25 20:09:03 [crit] 1613#0: *12 connect() to unix:/var/run/php-fpm.socket
2015/08/25 20:11:37 [crit] 1613#0: *16 connect() to unix:/var/run/php-fpm.socket
2015/08/25 20:15:40 [crit] 1613#0: *20 connect() to unix:/var/run/php-fpm.socket
2015/08/25 20:17:30 [crit] 1717#0: *1 connect() to unix:/var/run/php-fpm.socket
 
is there a "/var/run/php-fpm.socket" file there?
 
done
 
so, the file is there?
 
8:21 PM
yes it is exist: php-fpm.socket
 
hmm
 
Anonymous
This is a permission issue imo
 
yes, same idea
 
what is 'imo' ?
 
run command: cat /etc/passwd
is there a "www" user or "nginx" user?
^ delete please
but the answer is: "www"
 
8:25 PM
ok
 
Question!!!!!!!!!!!!!!
 
@tereško so ?
 
what are permission on /var/www/index.php file? which user owns it and which group?
 
Guys, when collecting LAST message from conversation, should I pull all messages form conversation and then use PHP to remove uneccessary messages?
 
@tereško sajad | wheel
 
Anonymous
8:26 PM
@Matthcw Why not just pull last messages?
 
that's wrong
do: chgrp www index.php
 
your mean is index.php ?
 
yes
 
done
 
Anonymous
always referesh
 
Anonymous
8:28 PM
after
 
Anonymous
editing
 
Anonymous
a
 
refresh mean restart ?
 
Anonymous
yeah ..
 
refresh means "browser" (also)
 
8:29 PM
still 502 :(
 
samayo, it's because I don't know how to ;'(
 
who owns /var/www ?
 
Let me show you something samyo
 
jsut to be sure
 
Anonymous
@Matthcw That's another question :D
 
@tereško how can I know it ?
 
Click
 
"ls -l" in /var folder
 
ah ok
 
Woot! One of my legs between US and Austrialia will be in business!!! Woo Hoo!
 
8:30 PM
drwxr-x--- 2 sajad www 512 Aug 25 20:01 www
 
Anonymous
@Matthcw wild guess have you tried changing ORDER BY m.msg_date DESC to ORDER BY m.msg_date ASC ?
 
No, the order isn't the problem, its the fact i keep getting multiple records for every message sent
instead of the LAST message of the chat
which I don't know how to do as I have mentioned
 
@Sajad 1sec , checking something else here
 
@tereško ok
 
Anonymous
@Sajad If this is your dev server, you can just try doing for now chmod 775 /var/www/ -R
 
8:33 PM
he's on a VM
I think the problem is not with the file but with the socket
 
Anonymous
Just to figure out if folder permission is the issue.
 
Anonymous
for the socket try chown www:www /var/run/php5-fpm.socket
 
@ircmaxell hm?
 
@samaYo s/www-data/www
@Sajad do this:
1 min ago, by samaYo
for the socket try chown www:www /var/run/php5-fpm.socket
that should be the fix
 
chown: /var/run/php5-fpm.socket: No such file or directory
 
8:35 PM
chown www:www /var/run/php-fpm.socket
 
Anonymous
:/
 
(without the 5)
 
@NikiC implicit safety or speed, state your preference please ?
 
then restart php-fpm and nginx
 
@JoeWatkins safety as in segfault or as in race?
 
8:37 PM
@tereško I can not run this: chown www:www /var/run/php-fpm.socke
 
Anonymous
@Matthcw use LIMIT 1 at the end
 
race
always avoidable, of course
 
@Sajad it should be "socket" not "socke"
 
@JoeWatkins In that case, no idea. Depends on how much performance impact you're talking
If it's only moderate, I'd go for implicit safety
 
(sorry, I made 3 typos in a sentence where I was trying to fix the typo, @Sajad)
 
8:38 PM
@tereško done ! :)
 
Anonymous
&?
 
restart service and refresh browser
 
:((
still 502 Bad Gateway
 
what is in nginx error log?
anything new?
 
@NikiC I'll measure ... thanks ...
 
8:39 PM
where was that ? (error log)
 
/var/log/..something
 
Anonymous
tail /var/log/nginx/error.log
 
I'm thinking it's going to be considerable ... but I haven't yet measured ... iteration I've measured but not read/write/unset/isset ...
 
Limit 1 only gives me one result,
so if i have 5 friends messaging me, I only get 1 notification
 
2015/08/25 20:01:13 [crit] 1613#0: *4 connect() to unix:/var/run/php-fpm.socket
2015/08/25 20:04:41 [crit] 1613#0: *8 connect() to unix:/var/run/php-fpm.socket
2015/08/25 20:09:03 [crit] 1613#0: *12 connect() to unix:/var/run/php-fpm.socket
2015/08/25 20:11:37 [crit] 1613#0: *16 connect() to unix:/var/run/php-fpm.socket
2015/08/25 20:15:40 [crit] 1613#0: *20 connect() to unix:/var/run/php-fpm.socket
2015/08/25 20:17:30 [crit] 1717#0: *1 connect() to unix:/var/run/php-fpm.socket
2015/08/25 20:26:59 [crit] 1717#0: *5 connect() to unix:/var/run/php-fpm.socket
 
8:41 PM
fuck
 
Is it common to get more results from the database and aggregate these manually?
 
hmm
@Sajad check the permission for /var/run/php-fpm.socket
 
how ?
 
go to the directory and do "ls -l"
 
Anonymous
@Matthcw What you are asking is a bit confusing, you said you want to get all messages, but then also want to get the last message only?
 
8:44 PM
srw-rw---- 1 root wheel 0 Aug 25 20:40 php-fpm.socket
 
1sec, checking
 
ok
 
@samaYo you were wrong :P
 
Anonymous
:D where
 
@Sajad open file /usr/local/etc/php-fpm.conf
 
8:45 PM
shouldn't a socket be like executable?
 
@NikiC I upgraded one of the flights, 15 hours...
 
Anonymous
I knew it, it was the user/group thing right? @tereško :)
 
so ?
 
Anonymous
It's still using apache?
 
few lines below "listen=/var/run/php-fpm.socket" you will see:
 
8:46 PM
@samayo haha, No the PROBLEM is im getting all messages, so as awork around i decided to just get all of them and ignore the rest.
 
;listen.owner = www
;listen.group = www
;listen.mode = 0660
@Sajad it should be
listen.owner = www
listen.group = www
listen.mode = 0666
 
What i WANT is to get the last messages WITHOUT getting the rest from the server
 
Anonymous
@Matthcw That is what LIMIT 1 exactly does.
 
@samaYo no, the fpm is overriding the permissions
 
@rdlowrey So when do you start?
 
8:47 PM
Ok Imagine this samayo
 
save and restart ?
 
a social networking site
with chat functinality
 
save and restart php-fpm
 
OMG !!
my website opened !!!
tnx God :)
 
Anonymous
damn :D
 
8:48 PM
I have friends, so i chat with them, at the end of the conversation the last message is displayed in the "MOST RECENT CONVERSATIONS" tab, so I know who I was talking to and what was last said
 
@Sajad now, try adding real php code in /var/www/index.php
 
Bt this is done for ALL 5 of my friends NOT just 1 friend
 
@tereško I did
<?php echo 'test'; ?>
 
Anonymous
@Matthcw I have actually built one with separate rooms and private chats, trust me .. there is no other way to do this
 
now only mysql is left to configure
.. sorry for the fuckup, but I actually thing it was good for your commmand-line skills
 
8:49 PM
Ohh so you have experience, nice, so can I do this in one query?
 
Anonymous
@tereško come on, let him learn something on his own, let him google and get few grey hair just like the rest of us
 
Anonymous
:p
 
Because when you say LIMIT 1, thats the whole query locked off to 1 result
Sajad
do you work for the CIA or Mi5
because you keep deleting posts
 
messages
 
8:51 PM
@Sajad for mysql you should try usiong this tutorial: digitalocean.com/community/tutorials/… (the step2 part)
 
Anonymous
@Matthcw is your code open sourced?
 
@Matthcw :D
@tereško ok
 
If it was opens sourced, I may give people a full head of grey hair, I am a learner PHP programmer lol
 
@Sajad don't delete msg i need to go through them while configuring
 
@AnmolRaghuvanshi ok
 
8:52 PM
@Sajad "sudo" translates to "execute as root"
 
samayo
 
How can I display all failed php-src tests again?
 
I will paste the whole code for you
 
@tereško I konw - I will do that as real root
 
Anonymous
@Matthcw ok
 
@Sajad you are starting to actually learn .. that's good
 
@tereško now ?
 
@Sajad now or tomorrow
 
I need to a break :) !
 
@kelunik just find *.diff in the php-src directory?
or whatever the syntax is.
 
8:54 PM
@Danack Yeah, just figured it out, thanks. :-)
 
@tereško I installed mysql, right ?
Step Two — Install MySQL
 
yes, it is already installed
but you need to make it actually work
 
I need to just config it ..
 
you have done the "pkg install mysql56-server" part
 
Anonymous
@Matthcw well your code is really very ... hmm nice :) anyway, you want to replace echo "No conversations!"; with the most recent (last) message right?
 
8:56 PM
Yeah
If there are no rows returned
You have no conversations
However, if there are rows, echo the rows
 
@Sajad I actually dont knwo how much configuration you will really need to do these days
 
@tereško its first step is sudo pkg install mysql56-server, I think I don't need to that
 
I have not used installed mysql in about 2 years
 
ah ok
 
Anonymous
@Matthcw so PUT your query there. You can not reuse your first query, its completely a different thing. You have to query there and use LIMIT 1
 
8:57 PM
I prefer postgresql (when possible)
 
no, I love mysql
 
Is nusoap outdated? I am getting a "XML error parsing SOAP payload on line 1: Not well-formed (invalid token)" on the generated WSDL and nothing online is solving this. I've been at it for almost 3 hours
 
My first query gets the posts, that's all it's supposed to do
 
@Sajad I am not even going to try to convince you otherwise
 
Wait, samaYo
Am I supposed to run the query multiple times?
 
Anonymous
8:59 PM
@Matthcw first of all do var_dump($numrows); inside that section
 
@tereško anyway I'm fine with mysql, I have not free time for learning 'postgresql' !
 
hmm ... @samaYo, you have grown in past 2 (?) years. I recall you being a complete disaster of a noob, who was convinced that OOP was evil.
 

« first day (1774 days earlier)      last day (3184 days later) »