logs archiveIRC Archive / Freenode / #php / 2015 / September / 17 / 1
VladDemise
before then, I didn't get access denied
I could log in, but couldn't use sudo.
du
is it possible there are no dotdeb php 5.4.45 packages for debian jessus
VladDemise
Now, access denied.
freite
du, you need to change the source then..but not all versions are available for every debian version
VladDemise
This is getting on nerves, bigtime.
Bittarman
du, thats possible, yes.
search dotdeb on its site.
VladDemise
I just want to log in as root, instlal memcached, and then I'm done...
Why isn't this already installed?!?
it's vital to websites imho.
du
okay, thanks. i think i'll just stick with 5.6
Bittarman
yeah, probably better.. not sure why you'd want 5.4 considering its about to go EOL.
         

ProNoob13
VladDemise: Not everyone uses it, and it adds a lot of quirks if you don't'know it's enabled. I'd just contact your hosting provider if I were you.
du
Boss doesn't want to do regression testing on a web site that was developed in 5.4
freite
should have installed whezzy then
since it's still supported
koolranch
Can you set session variables inside a function
Bittarman
yes
koolranch
Is there anything special I need or am I stupid
Bittarman
nope, nothing special.
just as long as session_start() is called somewhere first, you're golden.
VladDemise
Foma;;u
koolranch
hmmm
VladDemise
Finally.
laszlof
off by one error
koolranch
is there a reason why this isnt setting session variables in this? https://bpaste.net/show/54f55ccd4ff5
Alphos
yes, you're not calling session_start()
koolranch
Alphos it is being called in the document
Alphos
koolranch apparently after you set $_SESSION['v-logged']
koolranch
Is that causing the issue?
Can I not make a session a int?
Alphos
sure you can
but you have to call session_start() first if you want it to be stored in your session
koolranch
It's called at the top of the page, not within the function though
Alphos
apparently unsuccessfully
koolranch !+error reporting
php-bot
koolranch, Set 'error_reporting' to -1 and 'display_errors' to 1 in your php.ini and be sure to restart your webserver/fastcgi-listeners. This is more reliable than using ini_set() and error_reporting() in the script, which will fail if there are parse errors. See http://php.net/errorfunc.configuration for more.
         

its-martin
On an old web application that is supposed to display some error messages, someone today saw an actual exception with file and line number (zend 2 InvalidArgumentExceptionFile message). How can I make sure this doesn't happen again. Are there other things I should check besides, say, error_reporting() values?
Alphos
its-martin keep error reporting to its current level, but set display_errors to Off, and set an exception handler that logs your exceptions and doesn't display them
laszlof
wrap the whole thing in a try/catch statement :)
Alphos
(the latter part may not be necessary, but at least you'll have more info than what the log says)
laszlof essentially the same thing !
laszlof
pretty much
Alphos
functionally equivalent
AliG1000
I am using a map service that returns ([H] => 40.803861 [L] => -124.150139
). Unfortunately, and I don't know why, sometimes they alter the letters. The order of the results is unchanged. Currently I am using $segment_coords_temp = array( $segment_points[$i]->L, $segment_points[$i]->H ); to separate them out but this needs updating when they decide to alter things - can I use a different way to achieve the same?
koolranch
Alphos still nothing
Alphos
koolranch !+bom find
php-bot
koolranch, find . -name '*.php' -print -exec xxd -g 3 -l 3 {} ';' | awk '{print $2?$2:$1}' | grep -B 1 efbbbf
its-martin
err sorry I messed up the first part of that. It shouldn't show an end-user anything other than like the "Whoops we had an error" sorta page rather than the exception name and filepath and such. This is the normal behavior, so I'm a bit confused how suddenly someone ran into it today. (I don't have more details unfortunately)
Alphos
Bittarman : i knew this would come in handy at some point :D
PsychoBoB
eloquent
do you know
Alphos
its-martin so you're asking us to guess ?
AliG1000
@its-martin do you have a custom error handler?
its-martin
eh. talking it out while I think about it. mind is jogged by other people's ideas.
Alphos
its-martin : look at your git history, and/or pull from clean version,
CodeRebel
I have a header in an include script with my menu in it. The menu has a bar over the active page. This allows me to change one file when I update menu items. How can I make a script that recognizes which page it's own to make that menu item the active one?
i would look it up but i don't even know how to phrase that question for search
Sammitch
does anyone know of any relatively simple examples of using Promises that actually do a *real* thing? Like something I could actually run and tweak and use to get this concept into my brain?
Alphos
CodeRebel set a value in the including script, check it in the included script
Sammitch : jquery ajax ?
CodeRebel
can u elaborate?
Sammitch
Alphos: PHP promises
Alphos
Sammitch : then no :p
CodeRebel
or maybe a tutorial or something i can study
i don't want ot just fix this, i want to understand it for future projects ya know what i mean
Sammitch
Alphos: I mean, there's https://github.com/reactphp/promise but all their examples are pure fluff
koolranch
Alphos, I set a SESSION outside of the function and it works, it just doesnt want to set within the function
Alphos
CodeRebel in foo.php : <?php $activepage="foo"; include "header.php"; // in header.php : <span <?php if ($activepage==="foo") { echo 'class="active"'; ?>>foo</span>
koolranch are you calling the function ?
AliG1000
@CodeRebel take a look at http://php.net/manual/en/control-structures.switch.php and ($_SERVER['PHP_SELF']); Essentially, you can see what page the user is on using ($_SERVER['PHP_SELF']); and then write a switch statement that alters the class of the menu item e.g. class="active"
koolranch
Yes I am
$checkRegister = user_login("test", "lel", $db);
if($checkRegister == 1) { echo $_SESSION['v-user']; } else { echo error_code($checkRegister); }
Alphos
AliG1000 PHP_SELF is unreliable at best
AliG1000
which is better?
HyperTexT
This is directed to anyone who is farmiliar with and has used MVC/HMVC in PHP for a while. I'm just now trying to implement it on my own projects and I've come across conflicting opinions on just how it should be done in PHP. Specifically, I'd like to ask what you guys think of https://r.je/views-are-not-templates.html
CodeRebel
thanks alphos
Alphos
AliG1000 : something based on $_SERVER['REQUEST_URI'], using parse_url() among other things
CodeRebel
imma try it real quick
so say it's the about page. replace foo with about
Sammitch
all templates are views, but not all views are templates.
mel|
what would be the best way to normalize strings for comparison?
CodeRebel
in header.php for each menu item i include the same line of code customized to its link, then the actualy page being viewed will determine which page it's on?
HyperTexT
Sammitch what about interaction between models and views?
Alphos
HyperTexT : not to be rude, but tl;dr
NoiseEee
mel|: trim the strings and strtolower or something if you don't care about comparing case
Sammitch
HyperTexT: afaik views and models should never interact
CodeRebel
just so ur comment ali. Thanks
Alphos
mel| what kind of strings ?
and what kind of comparison ?
Sammitch
request is routed to a controller, controller interacts with models, data is produced and formatted according to the specified view.
CodeRebel
alphos description kinda makes sense to me but not completely. in header.php i need to span each link and the$activepage code how does the home page recognize that from the header?
mel|
Alphos, to find occurences of values that can be written differently
with Umlauts for example
CodeRebel
or Ali. Can you help me with this?
Alphos
mel| do you need to know what the differences are ?
CodeRebel
I just need to understand it cause this is a very content intense site I'm developing
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 next »