logs archiveIRC Archive / Freenode / #php / 2015 / October / 14 / 1
Chunk2
I've never used a profiler before, but it seems like this is the kind of situation that calls for it
ManicPanic
dont make a OOM(Object, Orientated, Mess). Just K.I.S.S
Es0teric
quick question -- what can be the possible cause of a constant's text echoing instead of its value?
Sammitch
but yeah, OOMs are fun. < OS> PHP is using all the ram! *kills crond*
Es0teric
so if i do echo CONST; the output would be "CONST"
instead of the value it contains
Sammitch
Es0teric: your constant isn't defined, so PHP assumes you wanted the literal string of your constant name
there's a warning for that, if warnings were enabled :P
Chunk2
Sammitch: haha! For me what it usually kills is mysql
Es0teric
Sammitch the constant is defined though...
thats the thing
Sammitch
Chunk2: ooh yeah, that's a bad one. we have a cron that runs near-constantly that echoes mysql's PID into a certain file that protects it from oom-killer
         

Chunk2
At least on the production server. Which we apparently CANT spin off to another instance because " latency"
Sammitch
Chunk2: just disable oom-killer and let the server kernel panic until they give you more resources :D
(Action) is BOFH
Chunk2
And the thing is, putting mysql on a separate server wouldn't slow down actual page loads significantly at all, because we cache
And it would let us use load-balancing sanely
Sammitch
Es0teric: you may have defined it *somewhere*, but it's definitely not defined when that code runs.
Chunk2: do a proper writeup and rebut the claims, extoll the benefits. challenge them to do an actual test instead of being afraid of the "latency boogeyman"
if your gear is all in the same AZ the latency should be <5ms if not <1ms, and if that still causes issues with your application then your application needs to be re-examined.
mariuscc
where I could search more info about something like this: ] WARNING: [pool www2] child 47324 said into stderr: "NOTICE: PHP message: 32759"
Sammitch
mariuscc: google?
mariuscc
I mean in logs
google give nothing
themightyabby
where are you seeing that error mariuscc ?
which logs?
I have a feeling you're int he wrong log ...
mariuscc
var/log/upstart/ php5-fpm.log
var/log/php5-fpm.log gives nothing
Sammitch
mariuscc: I would wager that whatever application you're running has an error description for ID 32759
themightyabby
do you have display errors turned on? Maybe the error is being logged outside of those "normal" places
mariuscc
hmm
I actually think I do
Shogoot
Hi all. Im trying to do some insert from on server to another. They are in same dmz sort of speak, but i cant get php to establish a connection. I can do mysql -u user -h ip -p and conect like that, but not with php and mysqli. any suggestions? Its not firewall realted, nor selinux.
Hi all. Im trying to do some insert from on server to another. They are in same dmz sort of speak, but i cant get php to establish a connection. I can do mysql -u user -h ip -p and conect like that, but not with php and mysqli. any suggestions? Its not firewall related, nor selinux, one is flushed and the other is disabled on both machines.
Naktibalda
Shogoot: what error do you get?
Shogoot
mysql_connect(): Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (13)
Naktibalda
!perror 13
SyntaxTerrorCat
Hi Shogoot.
Naktibalda
OS error code 13: Permission denied
Shogoot
hi SyntaxTerrorCat
prestorium
hi all. Suppose that I'm going to create my own framework and that I don't want to use Symfony HTTP Foundation. But I do want my framework to be compatible with symfony HTTP-related bundles. If I follow PSR-7 should I be OK?
         

Naktibalda
Shogoot: it must be caused selinux, apparmor or something similar
caused by
SyntaxTerrorCat
Shogoot, mysql_connect() is deprecated and removed from php.
Shogoot
Yes, i know its permission denied. But why is what im tring to find out. but as i sid, by terminal i CAN connect using mysql. But php cant...
SyntaxTerrorCat, $this->conn = new mysqli($host, $user, $passwd, $database); is what im using.
SyntaxTerrorCat
Shogoot, you should investigate what Naktibalda said.
You're using Centos?
clemf
Does php have anything like ruby's attr_accessor for automatically creating getters/setters?
Shogoot
SyntaxTerrorCat, centos on my php machine and the db is on a old fedora 15.
themightyabby
clemf: there are the magic __get and __set methods, but I'm not sure how ruby does theirs
there are probably better ways to do that though
Shogoot
SyntaxTerrorCat, accurate error: Warning: mysqli::mysqli(): (HY000/2003): Can't connect to MySQL server on 'x' (13)
Literphor
prestorium, That's a question you should ask #symfony
prestorium
Literphor, ops! sorry
Literphor, thanks
clemf
In ruby it's amazing you just put attr_accessor(:property1, :property2, etc) at the top of your class and it does it for you
SyntaxTerrorCat
Shogoot, either disable apparmor or SELinux, or configure it
Shogoot
SyntaxTerrorCat, and as selinux and firewalls go they are disabled and empty on both machines (i know...)
Literphor
prestorium, No problem, I had to check to make sure the channel existed :p
nodata
in which channel i can question about .htaccess url rewrite ?
Naktibalda
nodata: #httpd
nodata
Thanks
Shogoot
(Action) needs a Knight in shining armor
SyntaxTerrorCat
Shogoot, using socket for mysql connection?
Shogoot
No. Should i?
SyntaxTerrorCat
No.
Naktibalda
Shogoot: have you set this? http://unix.stackexchange.com/questions/31735/selinux-outbound-access-to-other-sites-with-restrictions
SyntaxTerrorCat
Shogoot, http://www.filonov.com/2009/08/07/sqlstatehy000-2003-cant-connect-to-mysql-server-on-xxx-xxx-xxx-xxx-13/
Might be that.
Basically, what Naktibalda mentioned.
After this, I do not have any ideas of what the problem could be other than Something on your system is denying permission, and you need to find that out.
Shogoot
Naktibalda, i cant see how this can afect my system as selinux is disabled
Naktibalda
double check
converge
anyone knows the difference betwen $paymentRequest = new \PagSeguroPaymentRequest(); and $paymentRequest = new PagSeguroPaymentRequest(); ?
Naktibalda
converge: it depends on a current namespace
Korvin
converge, if you're in the global namespace, nothing
converge
when I use PagSeguroPaymentRequest(); it says class not found, it only load the class with the /
Naktibalda
converge: !+namespaces
php-bot
converge, Please see http://php.net/manual/en/language.namespaces.rationale.php
profsimm
I'd welcome any tips how to implement interface seggregation in PHP without type intersection. In TypeScript I do this: function (SqlConnection & WithTransactions & WithGenerators conn) {}
In PHP we can't do this. Any tips?
sanguisdex
long time duapl php dev, new to the composer world. How do I use a class from a package that I just added to the requirements of a composer.json file. its is tell me that it is looking inside of my app based on the namespace of my file. but I want it to look in vendors
I am very open roe reading documentation, but I can't find any
profsimm
sanguisdex: it looks in vendors, did you include Composer's autoload.php?
Shogoot
Naktibalda, oh. error is gone... AND a insert!
frikkin magic
sanguisdex
yes I did
profsimm
sanguisdex: what's the error?
wafflejock
yeah should basically just be a matter of including the generated autoload file from composer, that'll handle getting any of the dependencies you install with composer
converge
sanguisdex: im with the same issue
Naktibalda
sanguisdex: have you ran composer install ?
sanguisdex
OnceMe
when I do this public function bla { $stmt = $this->db->prepare("some query"); $stmt>execute(); return $stmt->fetch(PDO::FETCH_ASSOC); } and then while ($result = $object->bla()) { } I get infinity loop
any idea why?
Naktibalda
OnceMe: because you execute bla() repeatedly
and it returns the same result every time
OnceMe
ah so $bla = $obj->bla(); while($res = $bla) {} ?
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 next »