« first day (445 days earlier)      last day (4494 days later) » 

12:00 AM
i will do this under cd /usr/src folder?
 
You can do it under any folder as you're copying the output to a different folder anyways
I recommend to create a new empty folder and execute the commands in it, though
 
this command cd ssh2-0.10.tgz
should be: cd ssh2-0.10 right?
 
Oh yes of course
 
cp: cannot stat `./modules/ssh2.so': No such file or directory
 
Hmm
 
12:04 AM
configure: error: /bin/sh ./config.sub .with-ssh2 failed
 
Not sure if all of the commands above will work without administrative privileges
 
i see root@machine-name
 
The easiest solution would be to ask your root user to apt-get update, upgrade and install it
hm
Then simply
su apt-get update
no
su
apt-get update
apt-get upgrade
and apt-get install libssh2-php
 
can my administration close privillibjes for php packages?
 
What do you mean?
 
12:07 AM
i don't think so..He has no reason to do that
 
If you're the root user you should be able to do pretty much all kind of changes
 
i mean the reasonn that i can't see the package is that
my administrator don't want to install it
*doesn't
 
He doesn't want you to install new packages? Or he doesn't want to install new packages himself?
 
new php packages..I suppose so
because i have allready installed icecast audio server
 
Oh
Are you on a dedicated server or some kind of Virtual Private Server ?
 
12:10 AM
no the machine owns to me
 
cd /etc/apt/
ls -alh
Which permissions do you have for sources.list ?
 
drwxr-xr-x 4 root root 4.0K 2011-11-26 12:26 .
drwxr-xr-x 80 root root 4.0K 2012-01-03 23:12 ..
drwxr-xr-x 2 root root 4.0K 2010-07-05 17:29 apt.conf.d
-rw------- 1 root root 0 2008-10-13 22:43 secring.gpg
-rw-r--r-- 1 root root 514 2008-10-31 17:29 sources.list
-rw-r--r-- 1 root root 0 2008-10-13 22:43 sources.list~
drwxr-xr-x 2 root root 4.0K 2008-02-17 02:15 sources.list.d
-rw------- 1 root root 1.2K 2011-11-26 12:26 trustdb.gpg
-rw------- 1 root root 9.9K 2011-11-26 12:26 trusted.gpg
 
Well you said you logged in as root, so vim sources.list should work since you got read/write permissions on the file
 
no i logged as dapel with my password (ssh connection)
and then i typed
sudo bash
 
ok
but you should have read permissions on the file either way
 
12:15 AM
question:what is the easiest way to copy text from my terminal?(I use putty)
 
select it and right click
BUT
dont close the file using CTRL+ZZ
 
thx
in which file do you mean?(for read permissions)
 
press ESC instead, hit the double point key and type q!
to exit without saving
 
phpize
what this commads do?
single ./configure runs well
with no errors
 
phpize comes with sudo apt-get install php5-dev
i think
 
12:20 AM
checking build system type... Invalid configuration `.with-ssh2': machine `.with' not recognized
configure: error: /bin/sh ./config.sub .with-ssh2 failed
 
Further information can be found here: stackoverflow.com/questions/3108937/…
 
this errors for this : ./configure –with-ssh2 command
 
When you copy/paste it it replaces the - with a .
Just write it by hand
As mentioned though, installing it via aptitude would be way more easy
 
yes off course
aha!!
i find i found the problem
 
So?
 
12:25 AM
says that you must change some lines into ssh.c
but i don't know how to manage vi editor
let's begin
how to go to line 480?
i opened ssh.c and the first line in the comments says:php version 4
it's that ok?
 
hit the double-point key and write the line number
it's working fine then, just tested it
 
ok
wait a moment
 
Optionally I uploaded the patched file here
 
ok file is ready
 
Ok
So try to configure again
 
12:33 AM
can you write phpize ... command again?
 
phpize && ./configure -with-ssh2 && make
if you dont have phpize
apt-get install php5-dev
 
i will run this: phpize && ./configure –with-ssh2 && make
ok
same error
 
only run
phpize
 
done
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
 
ok
now try
./configure --with-ssh2
 
12:37 AM
WORKS!!!
 
and now type make
 
usr/src/ssh2-0.10/ssh2.c: In function βzif_ssh2_fingerprintβ:
/usr/src/ssh2-0.10/ssh2.c:537: warning: assignment discards qualifiers from pointer target type
make: *** [ssh2.lo] Error 1
 
β ?
 
i don't know
 
Run the patch by Bill Pitz
and run patch < php-libssh2.diff
 
12:40 AM
1 out of 1 hunk FAILED -- saving rejects to file ssh2.c.rej
i try this into ssh2-0.10 folder
 
Yeah this is where it's supposed to be
 
patching file ssh2.c
Hunk #1 FAILED at 477.
1 out of 1 hunk FAILED -- saving rejects to file ssh2.c.rej
what is 477?
 
An empty line
 
well i go to the terrace for a cigarete..
I will be back in a bount of ~6 minutes
 
Ok
Just managed to apply Bill Pitz' patch, it still doesn't compile properly though
 
12:49 AM
Has anyone had a chance to play with the new (maybe not new now that I look) SplTypes?
 
SplInt for instance?
I never really used anything else
 
SpInt what is that?
 
Yea @beta
 
SP|int
 
I like the idea of strong typing in PHP; I'm rather sick of regularly having to !is_string() // exception
Some of the comments go back a bit (2009 or thereabouts) but it says it's only in SVN; targeted for release with 5.4?
 
12:54 AM
True, but I already got used to something like !is_string() ;)
 
Yea; it's become second nature to me also; but I prefer to let the language handle the dirty work when possible. I find it a more graceful failure when I don't have to throw it.
 
oups
when i have changed ssh2.c
if have forgot a #
now make works!!
 
And so do I.
So basically you're saying it's targeted for release with 5.4? We only used it once at work but I've got no idea which PHP version they used.
 
Built complete
 
@user Great, no simply execute the copy command
 
12:59 AM
don't forget to run make test
 
@beta -- Not sure on the release, but it says only available in SVN; I just as well assumed
 
cp ./modules/ssh2.so /usr/lib/php/modules/ssh2.so
 
should i run make test?
 
@user726730 You can, but it's not really necessary.
 
cannot create regural file no such file or directory
cd /usr/lib/php/modules/ssh2.so no such file or directory
 
1:02 AM
@Bracketworks Hm I'm neither sure on the release. I also found some of the comments dating back to 2009 but the only information regardint it's current status is the fact it's currently in experimental phase.
- spelling_mistakes
 
php5 folder exists
 
@user726730 cd inside your ssh2-0.10/modules folder
you should have a ssh2.so file there
 
yes
there is
 
@user726730 Damnit, PHP5 apparently stores the modules elsewhere
let me find them
 
take your time
 
1:05 AM
/usr/lib/php5/
I've had a sub folder inside this folder called 20090626
It contains all my modules
/usr/lib/php5/20090626
 
cd there
wait
20090626+lfs
is it right?
 
uhm
yeah it should be this one
 
only .so there
 
Ok
copy your ssh2.so in this folder
 
cp ssh2.so /usr/lib/php5/20060613+lfs
right
in the folder exist and ssh2.la file
must be copied too?
 
1:10 AM
You only should be required to copy your .so files in there
 
ok
now edit php.ini?
or restart apache?
 
try to restart apache
i think the changes already should reflect since you created a seperate ssh2.ini config file
 
function ssh2_connect doesn't exist
 
urgh
 
<?php
if (!function_exists("ssh2_connect")) die("function ssh2_connect doesn't exist");
// log in at server1.example.com on port 22
if(!($con = ssh2_connect("server1.example.com", 22))){
echo "fail: unable to establish connection\n";
} else {
// try to authenticate with username root, password secretpassword
if(!ssh2_auth_password($con, "root", "secretpassword")) {
echo "fail: unable to authenticate\n";
} else {
// allright, we're in!
echo "okay: logged in...\n";

// execute a command
if (!($stream = ssh2_exec($con, "ls -al" ))) {
 
1:13 AM
The scripts appears to be fine.
What's the output of php -m |grep ssh2 right now?
 
in php.ini how can i search the string "ssh2" from vi editor?
 
:/ssh2
 
nothing returns php -m |grep ssh2
Pattern not found
 
I also do have a /usr/share/php5-ssh2 folder for some reason
It contains a file ssh2.ini-dist containing the text extension=ssh2.so
 
i don't have php5-ssh2 folder
 
1:17 AM
My one probably got created by aptitude
In your make folder
 
i have php5 folder which includes php.ini-disst
 
Can you try running make install?
 
ok wait
make install into /usr/src/ssh2-0.10
ok?
returns just this
 
Yes.
 
i restarted apache with no sense
 
1:22 AM
Hmm
 
i don't know if you see that
so i repost it
iInstalling shared extensions: /usr/lib/php5/20060613+lfs/
 
I saw it, yet I'm not sure why it's not working.
 
what's wrong now?
 
It would be so much easier if you just got it to work using aptitude lol
 
tell me the command to type it into php.ini
hahaha!!
maybe i must change the daemon?
 
1:27 AM
Just a second
I didn't sleep for like 36 hours and will be off soon
 
great record!!
 
If I remember correctly this was the tutorial I used to install it on my old Debian server long time ago
 
does PHP have the ability to detect running app on client's pc?
 
The change you need to do is equivalent with one you would do to a seperate config file
extension=ssh2.so
 
php -m |grep ssh2 doesn't return something
 
1:29 AM
@skeith On which OS? I did something like this on a Debian server some months ago.
 
clients would be mostly using windows OS
but having a php script to detect cross platform is awesome
 
Oh sorry, I thought you were talking about server's processes
PHP is a server side language, you can't access client information like this
 
yeah, I've read about that
security options FTW
 
You can't even do it with JavaScript
 
i don't want to have ssh connection to a random client
 
1:32 AM
It probably would work with a Java Applet though, but they'd have to accept the execution of the applet
 
@beta unless with a plugin right? such as the adobe plugin which allow the browser to open adobe
 
extension=ssh2.so but nothing changed :(
 
@skeith Yeah it's an addon for i.e. Firefox
@skeith If you're coding a browser addon you might be given more options, my skills regarding this topic are way too rusty to give a constructive answer, though
 
my phpinfo report
 
@beta i'm still a learner, even coding a simple php page cost lot's of days for me
 
1:37 AM
@skeith We all are learners. There's always new stuff to play around with.
 
@beta into phpinfo says that /etc/php5/apache2/conf.d/ssh2.ini is parsed
so what's the error?
 
@user726730 Perhaps it's still unable to find the ssh2.so
 
this files has ".extension=ssh2.so."
php -m |grep ssh2
returns
ssh2
 
Sounds like it already has been loaded
Still wondering why your script won't execute properly
SSH2 should show up when executing phpinfo
 
well let's try this: /etc/init.d/ssh restart
no luck
 
1:44 AM
Wouldn't this affect only your SSH daemon
 
after that i restart apache too
before when i typed /etc/init.d/ssh restart the bash shell programm not found
or something
 
Does ssh2 show up in phpinfo ?
 
vi /etc/ssh/ssh_config
maybe i must change something
maybe not
 
Nope
As long as you can ssh from that server to a different box it should be fine
 
i can't find the error
everything seems to be ok
 
1:52 AM
Exactly.
 
i clear extension=ssh2.so
from php.ini and now php -m |grep ssh2
returns nothing
 
That's bad
php -m | grep ssh2 means the ssh2 module has been loaded.
 
so i must write back
extension=ssh2.so
into php.ini?
gd.so mcrypt.so mysqli.so mysql.so pdo_mysql.so pdo.so ssh2.so
all under /usr/lib/php5/20060613+lfs/
 
Yes you should revert the changes
So that ssh2.so is loaded again
 
there is also php.ini file in : /etc/php5/apache2/php.ini
is a shortcut?
 
1:59 AM
Nope, it's the one used for some systems
 
because in phpinfo says that Loaded Configuration File : /etc/php5/apache2/php.ini
 
Ok
You might want to try applying the modules line to this file then
 
extension=ssh2.so ??
check
WORKS MAN
DONATE A BEER if you come to GREECE
 
lol
That's great to hear
 
well do you have any script in your library to connect via ssh?
 
2:08 AM
Yes, but all those scripts are optimized for my servers.
A simply SSH script can be found at the same site
 
ask you something: if i can connect via ssh from i can too from php_ssh2
right?
*from putty
 
sure
 
<?php
$connection = ssh2_connect('maria.netmode.ntua.gr', 22);

$auth_methods = ssh2_auth_none($connection, 'netmg056');

if (in_array('password', $auth_methods)) {
echo "Server supports password based authentication\n";
}
?>
doesn't echo anything
from putty seems to support password
 
2:24 AM
After you connected
Try something like
if(!ssh2_auth_password($con, "root", "secretpassword"))
die( "fail: unable to authenticate\n" );
 
2:35 AM
the script in http://kevin.vanzonneveld.net/techblog/article/make_ssh_connections_with_php/
in method 1 never stops
 
Sorry, need some sleep right now
If you still experience any issues feel free to mail me at contact [at] betamaster [dot] us
 
ok man
thx a lot
have a good sleep
 
Cya
 
3:01 AM
ugh, I don't know what happened to the day. Feel like I didn't get anything accomplished
 
I know I periodically ask this, but is there in fact anyone here with reasonable experience in XML schema design?
@CharlesSprayberry Have you wisdom in the world of XSD sir?
 
3:18 AM
@Bracketworks I am afraid not. I only have basic knowledge of XML
 
@CharlesSprayberry Darn
I've not seen a -11 question yet
-11
Q: html inside php (or vice versa)

l4ndm1n3I usually come to this site after spending 1,000 hours to figure my problem out on my own.... I have tried various combinations of php, html and javascript. Why the hell won't this work...? <?php $Month = "H": $Year = "12"; $url = "http://barchart.com/chart.php?sym=cth12&style=tech...

 
@Bracketworks Yea, I admit it isn't a great question but the -12 is just Internet rage imo. Its a brand new user, I think at -4 or -5 they get the hint
 
@CharlesSprayberry -- Agreed, I can't think of a question warranting this (maybe a few) but I've just not seen one go that low before; it was kind of a whoah -- lol
 
3:38 AM
Ooh, edorian's talk looks interesting
 
3:54 AM
"When writing tests means getting it done slower, nobody is asking you to do it!" [Edorian's Slide]
If only that were true...
 
@Anfurny yeah, worth the view
 
@ircmaxell I wish he would have made his case a case for what was in the title a little more forcefully. And he seemed to write-off "pragmatic" philosophy incredibly quickly.
 
yeah
Well, off to bed. Good night
 
ta
 
 
2 hours later…
6:33 AM
@Gordon nope, wasn't here...
@Gordon I've heard about that from @tereško but... I don't know if this will be the next big thing, I agree with some ideas (reducing gap between developer and user which is also my goal) but I don't believe separation is the way to go. We've (even you?) already experienced mvc and the whole over-separation imho does have advantages in a very limited number of cases (like smalltalk class browser where it is completely okay)
however in most of my apps I benefit from thin (none) controllers, rich domain model and generic "theme" (one visual look and feel shared across multiple domain classes)
where generic == automagic (in my opinion look and feel should be consistent so instead of coming with view for each model, shared view should be updated)
but thx for video :-)
 
 
2 hours later…
8:17 AM
morning
 
@edorian afternoon :)
How are you ?
 
All fine, thanks. You?
 
Fine and Shine.
I watched a bit of your Talk, congratulations nice stuff.
 
I've earned silver on today :) stackoverflow.com/badges/1564/phpunit
 
Woho... then congratulations again :D
 
8:27 AM
And thanks again :)
 
@edorian Seems like you are the first one !
Question: Would you gain anything by wrapping PDO in your application ?
 
What I gain from it is not having to deal with the PDO API which I kinda don't like doing
 
you don't like dealing with PDO API or wrapping the PDO ?
 
Also it makes decoupling easier as we have multiple database servers and a connection factory / pooling. Using the normal mysqli/pdo in there would mean having different abstraction layers
I don't like dealing with the pdo api
 
I can't think of practical use, because PDO pretty much covers all the DB's that PHP has drivers.
 
8:35 AM
As we don't have an ORM for ... $reasons
Err.. for me it's not about being able to switch database. If you do anything more than basic select/insert/update thats not going to work out anyways
PDO doesn't allow you do easily switch database later in a project if you didn't really make sure not to use any specifics (by testing against multiple dbs for example). And then you still need a way for your DB layer to have backend depended code
And once you switch out classic RDMS with some NoSql store or XML or Textfiles you can't use PDO anyways :)
So, imho, it's not there for the abstraction anyways. Even so, for example, the Piwik project has gone though a lot of effort to make PDO work with MySql, SqLite and Postgress
 
@edorian Have some up votes !
I am a kind of person who wants to know he is doing something. these will help me a lot.
Thanks a lot.
s\know\know why
 
8:55 AM
HAPPY NEW DAY!!!!
@edorian Signs over signs, it's the last year for the Mayas as well ^^
 
<?php

class A {

	public function __invoke() {

	}

}

class B {

	protected $A = NULL;

	public function __construct($A) {
		$this->A = $A;
	}

	public function doA() {
		$this->A();
	}

	public function A() {

	}

}

$B = new B(new A());
$B->doA(); //Now how would I invoke A object but not the A method of B.
?>
Confusing code.
Ah, so both works.
		//call_user_func(array($this->A,'__invoke'));
		//$this->A->__invoke();
 
@edorian gratz
 
iirc php will favor the function call over calling the closure if you don't do $callback = $this->A; $callback(); or one of the other way showed
@Gordon Thanks :)
 
9:11 AM
@OmeidHerat if you got invoke you should simply call call_user_func($this->A)
 
@Gordon What's the benefit over $this->A()?
 
@Gordon Cool. this is way cleaner.
 
@hakre $this->A() doesnt work, does it? PHP will think you called B::A()
 
@edorian So, does it means. calling the __invoke function is better then call_user_func ?
 
@OmeidHerat I'd just note name the property and the method the same and stick to $this->aCallback();
 
9:17 AM
@OmeidHerat it might be a bit faster because it doesnt need to go through call_user_func but unless you are doing this a couple thousand times it wont matter
 
(If i followed that train of thought correctly)
 
aight, Thanks @Gordon and @edorian
I am heading home now. so Later.
 
posted on January 04, 2012 by Sebastian Bergmann

Together with my friends and partners from thePHP.cc, Arne Blankerts and Stefan Priebsch, I will be giving an "Advanced PHP Development" training in Montréal in March. With all PHP topics, nothing counts more than their practical application. This is why thePHP.cc once again offers a highly interactive and practical training right before the ConFoo conference. Based on their own specific n

 
Syntactical problem, right.
 
9:50 AM
puh it's still early today
 
You didn't miss lunch, yeah
 
10:06 AM
i missed breakfast
 
10:32 AM
I'm having a legionaires breakfast.
But it's not helping.
 
Stop talking about food, I'm starving :'(
 
You know what? Eat something ;)
 
there's nothing at home. All the Christmas food has run out. I need to go refill on some foods
 
For the moment drink a cup of hot water.
That helps, too.
You already have water?
 
yup, been drinking cold though. Because it's so warm here
 
0
Q: change default images of google weather api

Yasir AdnanI found 2 posts in stackoverflow Changing weather icon on google weather api , Google Weather API and Using Custom image. I tried the first one with str_replace() but it's not working.here is the code i tried: <?php $xml = simplexml_load_file('http://www.google.com/ig/api?weather=new-york'); ...

Please help me.I posted the question
I'm trying to change the default images of google weather api.I want to use the custom icons.I use str_replace() for changing the link but it's not working!!
$iconData = str_replace("/ig/images/weather/", "/images/weather/", $current[0]->icon['data']); this should be work fine,right???
 
11:40 AM
@YasirAdnan "doesn't work" isn't much of a description. Is your objective to populate iconData with the correct path? What's going wrong there?
 
11:51 AM
@YasirAdnan that depends on the data you have as XML. You're basically asking how to replace something inside an XML chunk but you don't provide the XML to operate on. As your question is that unspecific, you probably don't get any useful answer.
 

« first day (445 days earlier)      last day (4494 days later) »