logs archiveIRC Archive / Freenode / #php / 2015 / July / 9 / 1
Forbidd3n
Bittarman: the crontab -e isn't the cron running - setup in cpanel it runs /var/spool/cron/abrest
cron
Bittarman
cpanel....
I do wish that would just die.
kegster
Does anyone recommend a linux distro to use for websites? I mean I see Ubuntu being used a lot by default
Forbidd3n
yes, but I have root access as ell
kegster
but I've been told to use CentOS, been told not to use centos... so many choices and opinion ;)
Bittarman
kegster, basically the one you know best and not a desktop variant of it.
its hugely personal preference.
Chunk2
johndoe2: and you're using mod_php, did I understand right?
kegster
none better than others for any reason?
Chunk2
behind an nginx proxy but that shouldn't matter
         

kegster
seems like ubuntu comes with more updated versions of stuff, Bittarman
Bittarman
kegster, debian is bettter than them all, because its what I use and I know it like the back of my hand
kegster
:D
Bittarman
and I know which bits not to trust the package managers to maintain for me.
'better' is highly subjective in this territory.
Alphos
ubuntu is debian anyway :/
Bittarman
just get a 'server' variant, and you'll probably be ok
Alphos, I trust less of the ubuntu packages than I do debian ones :p
Alphos
meh
kegster
i guess i'll stick to centos, what i know;)
just upset about the whole 6.5 php5.3.3 bs
lol
Alphos
Bittarman : didn't ubuntu remove suhosin earlier than debian ? :p
kegster
i've heard bad things about cent7
johndoe2
Chunk2, yeah, I'm trying to figure it out, but I do know for sure that it's running behind nginx as a proxy, and apache is the actual app server. so most likely mod_ ... but I'm trying to confirm that now
Chunk2, yes mod_php. Server API is Apache 2.0 Handler
Bittarman
Alphos, I don't trust the php package maintainer for either distro, so... meh
:p
Alphos
:D
Bittarman
kegster, you can always use the source ;)
Bad_Advice_Cat
See, there are some differences.
Alphos
Bad_Advice_Cat you really want me to assume stuff, don't ya ? :p
Bad_Advice_Cat
If I am to trust the package maintainer for a distro or whatever.... If anything goes wrong. I could just google or fall back on source.
Chunk2
johndoe2: what we need to do now is try to eliminate as many other things that may be causing the error as possible. I'd SSH in and su as the user that needs to run the script, and see if it will let you
Bad_Advice_Cat
The point is to at least know what's going on with the packages.
kegster, the source is cool man. really cool.
Chunk2
That'll rule out anything unixy wrong with it, and you can focus on whether the problem is somewhere in your stack
         

Bad_Advice_Cat
Alphos, rofl. This is funny.
Alphos
:p
Bad_Advice_Cat
>.< I dun wanna be tortured
Alphos
oh come on, aren't you even a little curious ? :p
Bad_Advice_Cat
GAH
Alphos
:D
Chunk2
Hey I've got my PDO::ATTR_ERRMODE set to PDO::ERRMODE_EXCEPTION, but I've got one statement where I'm calling PDOStatement::execute and it's returning false without throwing an exception
Is this something that should ever happen?
Bittarman
Chunk2, yes.
johndoe2
Chunk2, gotcha. So let me reiterate: user is admin, php runs as admin (judging by whoami's $output). If I run the script directly from ssh/bash as the same user (admin), it works. If I do php -f myscript.php, it works as expected as well. So that's where my confusion lies. Hope this makes sense.
Bittarman
there are non-error failure conditions
Bad_Advice_Cat
Alphos, I'm having some fun exploring the different techniques of templates. Inheritance versus Nested templates.
Alphos
Bad_Advice_Cat "templates" and "fun" don't go well together imho
Bad_Advice_Cat
I almost never use inheritance. But I think I found a nice balance between inheritance and nested templates.
Oh wait, no I didn't >.<
Alphos
so, unfun ?
Bad_Advice_Cat
Still fun.
johndoe2
Chunk2, I found where vesta puts the config files - they're in the userdir. So httpd is running as admin (via mod_itk), and it's also got mod_ruid2 to run as admin.
Chunk2
johndoe2: well all the modules of httpd have to run as the same user
unless I'm terribly mistaken
johndoe2: well ok ITK makes that not a problem
johndoe2
Chunk2, that makes sense. I
Chunk2
Err, it allows you to run vhosts under different users, I mean
johndoe2
Chunk2, I'm assuming that since httpd is running as admin, mod_php follows. I don't know of a way to specify user for mod_php.
Chunk2
johndoe2: It looks like what this ITK thing does is make it to where the different Vhosts are running under different users
so check that your vhost is running under the php user you need
johndoe2
Chunk2, yup, that's all this is, a vhost configured to run as 'admin'. If I create another user in vestaCP it will create that user, and php will run under that new user (I checked whoami output and it returned the correct user)
Chunk2
weird. Sorry this is a lot of software I've not used before. I dont' think I can help you more than I have so far.
Try #httpd, they may have someone who knows quite a bit more about mod_itk
johndoe2
Chunk2, it would seem it does run under admin http://pastiebin.com/559d8d06ebf40 and that's what PHP says when I exec('whoami'). It just doesn't like me to run custom bash scripts...
Chunk2, I understand. I'm new to this as well, I do very much appreciate your time and suggestions. Thank you!
Chunk2
haha yeah I'm kind of in that awkward phase where I astound people who aren't programmers, but I feel dumb talking to a lot of the people here. I try to help where I think I can lol
Alphos
Chunk2 i've been in that phase for years now ! :p
johndoe2
Chunk2, heheh
Chunk2
I kind of wish PDO would still throw exceptions, and let me decide if they're show-stopping conditions by catching them.
Forbidd3n
Bittarman: I got it working!!
I changed the /usr/local/etc/odbc.ini and odbcinst.ini file to abrest usr and grp
it runs like a charm
it was a permission issue
Bittarman
cool
droid909
anyone alive?
AcidReign
Chunk2: what do you mean? PDO does throw exceptions...
Chunk2: http://php.net/manual/en/pdo.error-handling.php
Chunk2
AcidReign: Yes but there are some conditions which aren't considered errors.
AcidReign
Chunk2: such as?
Chunk2
as Bittarman said
AcidReign: The one I just had was that I accidentally passed an object instead of the array that's supposed to get passed to PDOStatement->execute
And the query quietly failed without raising an exception--the execute function returned false.
Bittarman
AcidReign, failures which do not come from mysql or a connection error still return false from execture on the statement class.
there are not many conditions which can cause it though
AcidReign
Bittarman: I'm aware, I was wondering what his specific issue was
Bittarman
kk
AcidReign
Chunk2: if you passed something other than an array to PDOStatement::execute() I would have expected an error too
Chunk2
I don't know if it was an oversight or a design decision
Bittarman
AcidReign
...especially considering it's being very strict about the array keys matching the placeholders in the statement (no extra keys allowed)
Bittarman
not even a warning.
its got me before
Chunk2
and man I was loving PDO so far
mewm
In a tad towards ddd principles, let's say I have an Account class, and an Entry class. An entry is supposed to get booked on an Account. Would it be okay to inject my AccountingInterface (which does the actual booking in the economy system) and use that in the a bookEntry() method on the Account class?
I'm trying to make my domain model richer..
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 next »