logs archiveIRC Archive / Freenode / #php / 2015 / July / 25 / 1
vacho
Bittarman: I wouldn't load 25mb of json in client browser.. I am looking to get the json feed via file_get_content and then decode it into a PHP array before parsing it. I need all 250k rows which is about 25mb. each row represents a seat and it includes a seat-serial-number
acro458
Tried to host first website. Getting error: "Domain not found - website.com"
CentOS 7
[Fri Jul 24 15:10:40.288851 2015] [:error] [pid 2744] [client 172.16.x.x:50187] PHP Notice: Undefined index: vis_module in /var/www/website.com/index.php on line 8
Dustin|Work
pastebin your code of index.php
acro458
It is encrypted
using zend guard
merkazu
bleh, zend guard
looked into using it but the threats of getting cryptolocker'd by license expirations turned me off
acro458
the software i want to use uses it :.
:/
laszlof
acro458: I suggest you contact the author of said software
sorabji
zend guard makes software undesirable though
what exciting thing overrides this terrible negative
laszlof
https://s3.amazonaws.com/uploads.hipchat.com/7453/919614/G60oFg2tUNYiXxI/nom.jpg
         

Alphos
if i wanted to use a piece of software and discovered it used zendguard, i'd stop wanting to use that piece of software
nikin
1000 iterations of my code on a 1000 char string takes 1.5 seconds. which is ok for a small company of 10-20 users using a dual core i3. But i would prefer to scale it somehow to about 100 users on the same system.
sorabji
1000 char string? what are you doing?
jbafford
nikin: pastebin your code and you might get someone willing to give you optimization suggestions
nikin
sorabji: i am hashing todo.txt items. so i only transmit the lines that changed through the network.
sorabji
hmmm, why not use something already built?
laszlof
right, anything with a concept of models will do that
nikin
sorabji: as i need the same calculation done in javascript
sorabji: and php and js has no built in hash in common
torontoyes
What is the php.cgi ? Ihave an issue where I copied a site but it says that I am already using a cgi handler and there is a conflict there.
What should i be looking for?
does it have somethikng to do with my cgi-bin/php.cgi file?
also.. what is the php.cgi file?
ice9
how to prevent page refresh from reusing the values from GET or POST?
verumequals
http://stackoverflow.com/questions/2089271/i-never-really-understood-what-is-cgi
Apparently the copied site tries to create a cgi handler instance but it's already configured for your server
I never used it though
alreece45
Is it a good idea to use a dedicated memcached instance for php sessions?
nikin
my code.. in 3 version including time benchmark: http://pastebin.com/xGfcdmZX
if anyone has any optimization tipps. then please let me know.
TruePika
In an Apache+PHP setup, my friend is having problems configuring where the scripts actually come from
e.g. requesting host/foo/bar.php is running /srv/httpd/foo/bar.php instead of /srv/httpd/htdocs/foo/bar.php
(I understand this might be an Apache issue, but I'm dropping by here just in case anyone knows)
and nvm, apparently said friend was messing around with rewrite rules for no good reason <_<
caffinated
you modify the document root on the vhost for that specific domain in httpd.conf
TruePika
caffinated: I had figured, but that didn't appear to be the problem
it was apparently stuff with messing around with Apache rewrite rules. I don't know how badly, but it's fixed, at least for now
caffinated
if the document root is set properly, then it's a problem with another rule modifying the path. because "/srv/httpd/htdocs/foo/bar.php" doesn't sound like something that should appear in the browser. it looks like an absolute filesystem path.
TruePika
that was an absolute path, with the Apache dir being /srv/httpd
I was mentioning the absolute path to indicate where in the tree it was trying to pull the files
(similar to how many cgi-bin aren't actually stored in the webroot)
anyway, problem apparently fixed
caseyd
is there a way for me to detect the difference between someone visiting "/file.php" and "/file.php?search_name=". It works when someoen searches, but when they search for nothing I'd like it to do something different than when they visit for the first time
Now I am just doing if (!empty($searchName)) {
caffinated
isset($_GET['search_name'])
then check to see if it's empty or not.
if you want it to something different the first time, set a cookie or session value after the first time.
or persist the fact in a database row. really depends on what you're doing and how you want to implement it.
         

KLVTZ
Following PSR-2, does anyone actually implement tags in class comments? Like It seems overkill if you already have that verbatim at the top of the file.
caffinated
what do you mean by "tags in class comments" ?
KLVTZ
caffinated: here is an example that passes: https://gist.github.com/d2ed1ab5553753592c17
You'll notice that code sniffer expects tags in the comment section (cat. pack. auth. lic. etc.)
it's redundant in my opinion to have this info displayed twice. Just wondered if anyone on here had any thoughts
caffinated
that's not really part of PSR-2, but it's a good idea as it creates a parsable documentation method.
KLVTZ
Ah yes thar did occur to me...what's interesting is some proponents of these standards don't follow this particular standard.
caffinated
This is useful for not only generating documentation, but also for IDEs to use
sure, but it's not in PSR-2. it's phpdoc blocks. basically an adaptation of javadoc.
KLVTZ
but if you where to write a package, would you include it? Because I would do something like this: https://gist.github.com/d2ed1ab5553753592c17
caffinated
yes, yes I would
php-developer
Hi. I want ask some question about using shared memory between few processes in php. Is anybody familar with that?
I will explain. I'm trying to create an object that holds some value in shared memory (using shmop ext). In this class I open memory segment. After that in user code some forks are created via pcntl_fork(). After if I delete this block in one of threads and create it with the same name, but with diffirent size, this new segment is not updated in other threads. The're have their own segments and this is strange
mjburgess
I would suggest you use IPC with zeromq php-developer
php-developer
thanks for suggestion, but I think such a rare extension like zeromq is bundled/enabled on less servers than shmop is. Also I'm trying to avoid unneeded dependencies in my works
mjburgess
caffinated
I think you'll find that shmop is even more rare.
retran
i've heard of zeromq. whats a shmop
caffinated
shmop is for creating segments of memory which can be accessed, read and written to by multiple processes
php-developer
yes, more low-level btw
caffinated it would be very good if it's true, but shmop is enbaled by default in latest stable debian release, for example.
retran
just use zmq because it's awesome
php-developer, is there any reason you giving pcntl_* functions a "free pass" on this "no rare extensions" requirement?
php-developer
there is not another good way to parallel code. Except for pthreads ext
retran
similarly, a messaging system is probably the only good way to handle shared data across parallel processes
not some brute thing like shlop
or whatever its called
shmop doesn't even give you what you'd get with memcache
php-developer
can agree. I just had a goal to multithread some work and collect all data in one storage. So this task put me on shmop implementation way.
retran
the behavior you describe makes sense, given shmop isn't client/server based
how would the threads know the size changed
frogdr
How would I go about routing in PHP?
starmaze
okay. So I've prepared and executed a statement. Now what do I do? closeCursor? There's nothing to catch
caffinated
starmaze: get the result(s) if any
retran
frogdr, write a resolver
starmaze
if an exception is thrown, do I need to catch to exit() or will the exception just close the scripy anyway?
caffinated
uncaught exceptions are always considered fatal
retran
catch the exception if you "care" about what happens next in your code
php-developer, curious why you are using a variable size for a given name in your scripts that use this name (for the block of mem)?
i'm probably thinking about things i shouldnt think about
gambl0re
is an associative array just like an object??
key value pairs?
TinoDidriksen
Yes
gambl0re
why is it used as an array?
ice9
does fgets() removes spaces from lines?
TinoDidriksen
gambl0re, why not? Assoc arrays are from before objects were in PHP, and the syntax makes sense when compared to other languages.
ice9, http://php.net/fgets :: "or a newline (which is included in the return value)"
« 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 27 next »