« first day (2242 days earlier)      last day (2705 days later) » 

10:02 PM
thnx
 
Day 5's challenge is fun like
 
it's after 4pm o.o
where did the time go
 
@Tiffany oh, missed that
 
I like the idea of yasuo's user-land session serializer interface but how do you properly indicate an error?
 
@MadaraUchiha what about FTPS? (hehe)
 
10:04 PM
Seems to me they should return null and switch to:
interface SessionSerializerInterface {
  function encode(array $session_data_array): ?string;
  function decode(string $serialized_session_data_string): ?array;
}
 
@LeviMorrison what about throwing instead?
 
@bwoebi :P
 
@bwoebi I mean... maybe.
 
@LeviMorrison I cannot imagine a case where not being able to encode/decode would be expected and not throw-worthy
 
But the current RFC doesn't mention failed attempts to encode or decode at all.
That's my bigger worry.
> // Returning anything other than string raises E_RECOVERABLE_ERROR
 
10:06 PM
@LeviMorrison Well, the RFC needs to show some behavior in case the functions throw
@LeviMorrison it should be TypeError as per return type hint
 
^ This isn't the same as what I'm talking about; that's just regular signature validation...
 
@Levi Please bring that up to internals and suggest proper throwing handling and no E_RECOVERABLE
 
@bwoebi Will do.
 
/me is watching a lecture series on youtube
 
10:13 PM
@tereško and you haven't fallen asleep yet?
 
first lecture had like 480'000 views
by the lecture 8 the view count has dropped to 56'000
 
or wait, you're watching it so you can get to bed
 
no, I am watching them to learn
 
Can someone help me with a line on cofiguirng nginx?
location ~ \.php$ {
..........
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #what does this do?
}
 
@Danack a wonderful way to indicate an error
@Tiffany 15 minutes until quitin' time here
 
10:17 PM
@rabbitguy 45 for me
 
I'll let you know how home is when I get there
 
@sweg_yolo_69 it sets the fast cgi param 'script_filename' to be whatever document_root concatentated by $fastcgi_script_name.
 
lol
 
nevermind, read Danack's response
 
@Danack Could you give me an example of what script_filename would be as well as $fastcgi_script_name?
I already figured out by myself what you said
 
10:21 PM
> Sets a file name that will be appended after a URI that ends with a slash, in the value of the $fastcgi_script_name variable. For example, with these settings

fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/www/scripts/php$fastcgi_script_name;
and the “/page.php” request, the SCRIPT_FILENAME parameter will be equal to “/home/www/scripts/php/page.php”, and with the “/” request it will be equal to “/home/www/scripts/php/index.php”.
 
The tutorial(digitalocean.com/community/tutorials/…) says to add that line, but it wasn't added on the default config on nginx
What I'm really asking is should I add that line or not?
 
If you need it, then add it.
 
so if someone enters domain.com/script.php it will load the script that is documentRoot/script.php ?
 
(you probably do need it, but you ought to understand both what you're trying to achieve, and what the config is doing)
@sweg_yolo_69 yes.
 
10:25 PM
Seems pretty obsolete when I use it with document root
Or will any php script not work without it?
 
1 min ago, by Danack
(you probably do need it, but you ought to understand both what you're trying to achieve, and what the config is doing)
 
I'll try leaving it out and see if php works
 
btw I have shitty notes for my config here
#enable rewrite log which spams the error log.
#rewrite_log on;
is a useful thing for seeing what nginx is doing.
 
I'll learn more about Nginx config later, now I just want to set it up so PHP works
I'll add that line because it's included in the tutorial
 
hmmmmm
 
10:33 PM
hello, anyone here used php code generation from protobuf by any chance?
 
so I have a freelance project I'm working on, I don't have ssh access to the server yet, and the original code is on my dead computer. I wanted to wait to begin working on the project again until I had ssh access so I could install git on the server. I know I already want to rewrite my code... debating on setting up a local git repo and begin working on rewriting it...
 
You reminded me of git @Tiffany
 
@Tiffany sounds like a plan to me
 
@sweg_yolo_69 ;)
 
Although I have no experience on how to use it besides the built in one for PHPstorm I would like to install it o nthe server
 
10:36 PM
run through that.
 
Didn't know codecademy has a course on Git
Though it's been a long time since I checked their site
 
it was added about a year ago
was a relatively recent addition
there's also an article to read about git branching, let me try to dig it up
my friend has linked it to me like three different times
 
The whole thing with branches and commiting confuses me. I just check my local history on PHPStorm from Git and that's it
 
codecademy does a pretty good job of explaining branches and stuff
I need to actually finish it.
 
Codecademy generally has good courses
I'll add that to my list of thing to "look into later"
 
10:41 PM
Probably my favorite difference between Git and SVN: Subversion allows you to check out just a subtree of a repository; Git requires you to clone the entire repository (including history) and create a working copy that mirrors at least a subset of the items under version control.
(I prefer Git in this case)
 
user379888
Offtopic: Does anyone have any interest in resume creation or review?
 
user379888
I am trying to start a website based on that. If any of Stack Exchange's members are interested please back my proposal:
http://area51.stackexchange.com/proposals/104744/resume
 
@bwoebi Draft to Internals; look good?
 
@LeviMorrison You still can't type callables right?
 
@LeviMorrison looks fine
@MadaraUchiha no.
 
10:45 PM
Assuming you mean their signatures, no.
 
@bwoebi Shame. Would have been perfect for that RFC
Yeah, I mean something like `($a) => array $fn
Wow that's more confusing that I thought it would be
 
@MadaraUchiha sorry, I do not understand your syntax
What ought that even mean?
 
It really annoys me that php5 and php7 have different paths:
/etc/php5/fpm/php.ini as opposed to
/etc/php/7.0/fpm/php.ini
 
callable(mixed): array $fn
Is that better?
 
@MadaraUchiha ah ($a): array $fn
 
10:47 PM
what are the opinions against "User defined session serializer"? apart from the feature creep...
 
=> looks for me like it introduces an expression or such ^^ @MadaraUchiha
@FlorianMargaine Basically what Levi said:
4 mins ago, by Levi Morrison
@bwoebi Draft to Internals; look good?
 
@bwoebi Hmm, aside from encryption, is there any other usecase for that RFC?
 
@MadaraUchiha Serializing using json? Dunno.
 
@MadaraUchiha dunno… reading/writing from other sources?
 
@LeviMorrison makes it easier to share the session engine across languages
 
10:49 PM
@LeviMorrison Yeah, but for what reason? serialization/deserialization is for internal PHP usage, is it not?
 
PHP is its own special snowflake that makes it hard to share sessions :)
 
@bwoebi As in... side effects?
 
@MadaraUchiha yes
 
shudders
 
@FlorianMargaine RFC by Yasuo
 
10:52 PM
So we have JSON, which is probably not a real usecase because no one actually reads serialized sessions, side effects, which sounds like abuse more than anything, and making the session engine compatible with other platforms, which you guys say is still hard
Ummm...
 
@MadaraUchiha "no one actually reads serialized sessions"...
 
@FlorianMargaine As in, no human actually reads serialized sessions
If you have a program that reads it, using unserialize isn't harder than json_decode you know
 
@MadaraUchiha Except that you have more tools available to help you do so instead of having to use PHP ^_^
 
Some databases even directly support JSON so perhaps it is of value there ^_^
 
10:54 PM
you have to use a special library that probably has more bugs than a JSON library.
 
OK, this is weird...
I deleted the default index.html from nginx and when I load the site I get an apache error page
 
Yeah, but @LeviMorrison just said that compatibility with other platforms is still hard
@sweg_yolo_69 sudo service httpd status
What do you get?
 
Loaded: not-found (Reason: no such file or directory)
Active: inactive (dead)
 
How does PHP store sessions under the hood anyway? Files?
 
anyway, I'm mostly in favor of dropping sessions tbh...
 
10:56 PM
However, when I load a phpinfo() page on the server it loads correctly
 
@MadaraUchiha By default yes. And our "session interface" didn't attempt to really abstract that :/
 
sudo service nginx status?
 
and I have $_SERVER['SERVER_SOFTWARE'] nginx/1.10.2
 
@LeviMorrison It still doesn't, even after this RFC...
 
Yasuo isn't crazy for wanting to improve PHP's sessions. He just doesn't deliver very well on proposals and implementations.
 
10:57 PM
I get lots of text and Active: active (running) for service nginx status
 
The RFC doesn't specify where you get the serialized/deserialized session from for unserialization/serialization
So I assume that part still comes/goes to files
Even if you try to be fancy and abuse it with side effects and database
 
you have ini options to change that behavior
 
It doesn't need files, no. We use Redis for sessions.
 
So I'm confused.
 
It is possible to do other things but the API sucks to do anything other than store it in files.
 
10:59 PM
What's your "session interface" then?
 
ini settings.
 
Both nginx and php7 are running fine but if there are no pages for the nginx root I get an apache default page???
 
@LeviMorrison which is not such a great idea, imho
 
@FlorianMargaine Eh, what's your gripe?
 
11:00 PM
@LeviMorrison what's your eviction policy?
 
Hopefully it's one we've already considered :D
 
either you're in allkeys-lru and that means you randomly drop sessions
 
Right, so in addition to this RFC, something like set_session_store_callable(($key, $value): void) and set_session_get_callable(($key): string) could be nice
 
or you're not, and it means the size of your session storage is limited to the amount of RAM you allocate to redis
which is pretty limited, by all standards
 
I don't dig the "let's set global callable flags" approach, but a full blown Session object isn't going to happen
 
11:02 PM
@FlorianMargaine I think volatile-lru.
 
@LeviMorrison so that means you're likely to hit OOM in case you get a spike of sessions, and your site will be down
 
No, we use Redis-cluster and don't have very many users.
 
@MadaraUchiha I get a permission denied error when I try to upload via sftp to /var/www/html
 
@sweg_yolo_69 That makes sense
 
11:03 PM
@FlorianMargaine This means there is a LOT more RAM.
 
Your user has no permission to write files to there
 
the 2nd part makes more sense
(after the edit, I mean)
 
Hence the configuration part :P
 
@MadaraUchiha How would I add permisions?
 
@sweg_yolo_69 The easy way would be to either make your user own /var/www/html or make /var/www/html's permissions more permissive
 
11:04 PM
We're open to other ideas, but memcache is even worse than Redis for sessions and it already had a session handler.
 
The more correct way would be to configure a user group with permissions to /var/www/html, and add your user to that group
 
@LeviMorrison have you benchmarked using an on-disk database?
and when I say "benchmarked", I don't mean "redis vs db", I mean "db session handling time within a request"
 
@FlorianMargaine No, but we intentionally did not use our existing mysql database servers. We want fewer things in them.
 
@LeviMorrison they have the advantage of having a lot more available space, basically unlimited
 
@MadaraUchiha so sudo chown -R USER /var/www/html/
 
11:06 PM
and no "OOM" or "dropped sessions" are possible, in practice
 
@FlorianMargaine Distributed databases are a pain though ^_^
 
@LeviMorrison redis-cluster is that thing where you lose 1/3 of your keys when one of the masters goes down, right? :P
 
@FlorianMargaine Only if you set it up incorrectly ^_^
 
so you've moved the pain of settings up distributed dbs to the pain of setting up distributed nosql stores? :P
 
Each node serves as a primary for one shard and a secondary for another. It's not INSANELY HIGHLY RELIABLE but it's good enough for us.
@FlorianMargaine This wasn't painful. Not at all painful compared to mysql...
To clarify I'm not saying everyone should use Redis for sessions ^_^
 
11:11 PM
@LeviMorrison uh, so you don't have "a lot more ram", just 33% more than one server
@LeviMorrison galera is not that bad
 
@FlorianMargaine Plus swap... and your numbers are assuming we use exactly 3 nodes in the cluster.
 
@LeviMorrison true
Redis doesn't use mlock?
I thought it did, weird
 
We were moving from single server to having redundancy.
This was a painless transition (zero code changes) to an adequately available solution.
 
@LeviMorrison yes, and 3 servers is the typical redundant stack, hence my assumption
 
We understood this risk but this far it hasn't bitten us at all.
 
11:14 PM
@LeviMorrison tbf, setting up a distributed database imposes no change on the code either
@LeviMorrison yup, if your scale isn't that high, it makes sense, as long as you're aware of it
 
A dropped session on our website is a minor annoyance. We don't have long-lived applications with session heavy usage or important things like commerce transactions.
 
@LeviMorrison in volatile-lru you'll get OOM, not dropped sessions
 
@FlorianMargaine I'll ask a sysadmin to look at it.
 
@LeviMorrison yeah, I'm heavily biased given that I host e-commerce websites
 
Our database server (which is enormous and has way too many things on it) is our last thing that isn't redundant.
If it goes down then we have downtime while we boot up another and load in backups.
 
11:18 PM
ouch :)
 
Most of our users don't use the website.
They ssh to our cluster and do stuff mainly.
And, in the 6 years I've been here we've never had a database outage.
So... we're not really a typical setup.
 
I'm not sure what is holding up the DB migration to something else.
My guess is partly that a lot of our scripts/apps that use it were not designed to for distributed and rely on auto-increment ids and other stuff.
 
ah, yes
 
11:44 PM
fucking pissed right now
 

« first day (2242 days earlier)      last day (2705 days later) »