From dsteplight at gmail.com Fri Jun 1 12:10:37 2012 From: dsteplight at gmail.com (Darryle Steplight) Date: Fri, 1 Jun 2012 12:10:37 -0400 Subject: [nycphp-talk] Which deployment apps are you using? Message-ID: Hi Everyone, I just heard of Capistrano, but in the past I've used Ant when I was using Eclipse for my IDE and working with JSP back in 07. What are the best deployment softwares for PHP? Which ones are the easiest to get up and running quickly? Which do you prefer to use at the job? -- ---------------------------------------------- "May the Source be with you." From chsnyder at gmail.com Fri Jun 1 12:13:25 2012 From: chsnyder at gmail.com (Chris Snyder) Date: Fri, 1 Jun 2012 12:13:25 -0400 Subject: [nycphp-talk] Which deployment apps are you using? In-Reply-To: References: Message-ID: On Fri, Jun 1, 2012 at 12:10 PM, Darryle Steplight wrote: > Hi Everyone, > ? ?I just heard of Capistrano, but in the past I've used Ant when I > was using Eclipse for my IDE and working with JSP back in 07. What are > the best deployment softwares for PHP? Which ones are the easiest to > get up and running quickly? Which do you prefer to use at the job? > Subversion and SSH here. I guess my deployments are pretty small, but I never saw the need for anything fancy with PHP. From rainelemental at gmail.com Fri Jun 1 12:21:49 2012 From: rainelemental at gmail.com (federico ulfo) Date: Fri, 1 Jun 2012 12:21:49 -0400 Subject: [nycphp-talk] Code together Message-ID: <802895317482091766@unknownmsgid> Today I'll be at Tea Lounge (Union St. Brooklyn) from 3pm to 6pm to work on my project, mail me if you want to hack in company with a good coffee or tea Sent from my iPhone From rmarscher at beaffinitive.com Fri Jun 1 12:23:10 2012 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Fri, 1 Jun 2012 12:23:10 -0400 Subject: [nycphp-talk] Which deployment apps are you using? In-Reply-To: References: Message-ID: <859A8841-E4AA-44D4-B656-BC34C4AF2851@beaffinitive.com> > On Fri, Jun 1, 2012 at 12:10 PM, Darryle Steplight wrote: >> I just heard of Capistrano, but in the past I've used Ant when I >> was using Eclipse for my IDE and working with JSP back in 07. What are >> the best deployment softwares for PHP? Which ones are the easiest to >> get up and running quickly? Which do you prefer to use at the job? I'm using a hand-rolled method that uses parallel-ssh to simultaneously update servers, combined with custom php code for handling migrations, and git tags for managing releases and allowing to roll back (assuming there aren't major migrations that would prevent roll back). Facebook puts conditional checks all over their code for different features. Enabled features are cached in APC. They have a private url/api for enabling/disabling features by updating the APC cache keys. That way they can roll out code changes without it actually going live and the test features in production selectively on certain servers. Here's how Etsy does it: http://codeascraft.etsy.com/2010/05/20/quantum-of-deployment/ Here's a php based deploy method created by Rasmus: http://blog.wepay.com/2010/11/30/weploy-wepays-deployment-tool/ From dsteplight at gmail.com Fri Jun 1 12:35:03 2012 From: dsteplight at gmail.com (Darryle Steplight) Date: Fri, 1 Jun 2012 12:35:03 -0400 Subject: [nycphp-talk] Which deployment apps are you using? In-Reply-To: <859A8841-E4AA-44D4-B656-BC34C4AF2851@beaffinitive.com> References: <859A8841-E4AA-44D4-B656-BC34C4AF2851@beaffinitive.com> Message-ID: @Chris- At the very least, everyone should probably be using some sort of version control and SSH. If I have a choice I would prefer to use git though even though I'm stuck using SVN for a few projects I'm working on. @Rob - That looks like some solid info and methods. I haven't used APC before but I definitely see where it can come in handy. I always wonder how Facebook did it too. Thanks for the info. On Fri, Jun 1, 2012 at 12:23 PM, Rob Marscher wrote: > >> On Fri, Jun 1, 2012 at 12:10 PM, Darryle Steplight wrote: >>> ? ?I just heard of Capistrano, but in the past I've used Ant when I >>> was using Eclipse for my IDE and working with JSP back in 07. What are >>> the best deployment softwares for PHP? Which ones are the easiest to >>> get up and running quickly? Which do you prefer to use at the job? > > I'm using a hand-rolled method that uses parallel-ssh to simultaneously update servers, combined with custom php code for handling migrations, and git tags for managing releases and allowing to roll back (assuming there aren't major migrations that would prevent roll back). > > Facebook puts conditional checks all over their code for different features. ?Enabled features are cached in APC. ?They have a private url/api for enabling/disabling features by updating the APC cache keys. ?That way they can roll out code changes without it actually going live and the test features in production selectively on certain servers. > > Here's how Etsy does it: > http://codeascraft.etsy.com/2010/05/20/quantum-of-deployment/ > > Here's a php based deploy method created by Rasmus: http://blog.wepay.com/2010/11/30/weploy-wepays-deployment-tool/ > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation -- ---------------------------------------------- "May the Source be with you." From rainelemental at gmail.com Fri Jun 1 13:13:35 2012 From: rainelemental at gmail.com (federico ulfo) Date: Fri, 1 Jun 2012 13:13:35 -0400 Subject: [nycphp-talk] Which deployment apps are you using? In-Reply-To: References: <859A8841-E4AA-44D4-B656-BC34C4AF2851@beaffinitive.com> Message-ID: <8405364077888079087@unknownmsgid> Well here's the Facebook structure http://www.quora.com/What-is-Facebooks-architecture Believe it or not the base code is still PHP, compiled to HH ByteCode, but yet they write PHP :) Sent from my iPhone On Jun 1, 2012, at 12:35 PM, Darryle Steplight wrote: > @Chris- At the very least, everyone should probably be using some sort > of version control and SSH. If I have a choice I would prefer to use > git though even though I'm stuck using SVN for a few projects I'm > working on. > > @Rob - That looks like some solid info and methods. I haven't used > APC before but I definitely see where it can come in handy. I always > wonder how Facebook did it too. Thanks for the info. > > On Fri, Jun 1, 2012 at 12:23 PM, Rob Marscher > wrote: >> >>> On Fri, Jun 1, 2012 at 12:10 PM, Darryle Steplight wrote: >>>> I just heard of Capistrano, but in the past I've used Ant when I >>>> was using Eclipse for my IDE and working with JSP back in 07. What are >>>> the best deployment softwares for PHP? Which ones are the easiest to >>>> get up and running quickly? Which do you prefer to use at the job? >> >> I'm using a hand-rolled method that uses parallel-ssh to simultaneously update servers, combined with custom php code for handling migrations, and git tags for managing releases and allowing to roll back (assuming there aren't major migrations that would prevent roll back). >> >> Facebook puts conditional checks all over their code for different features. Enabled features are cached in APC. They have a private url/api for enabling/disabling features by updating the APC cache keys. That way they can roll out code changes without it actually going live and the test features in production selectively on certain servers. >> >> Here's how Etsy does it: >> http://codeascraft.etsy.com/2010/05/20/quantum-of-deployment/ >> >> Here's a php based deploy method created by Rasmus: http://blog.wepay.com/2010/11/30/weploy-wepays-deployment-tool/ >> >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show-participation > > > > -- > ---------------------------------------------- > "May the Source be with you." > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation From rmarscher at beaffinitive.com Fri Jun 1 13:32:56 2012 From: rmarscher at beaffinitive.com (Rob Marscher) Date: Fri, 1 Jun 2012 13:32:56 -0400 Subject: [nycphp-talk] Which deployment apps are you using? In-Reply-To: <8405364077888079087@unknownmsgid> References: <859A8841-E4AA-44D4-B656-BC34C4AF2851@beaffinitive.com> <8405364077888079087@unknownmsgid> Message-ID: <72662A35-D814-4CE8-87F8-E2463AFF85DA@beaffinitive.com> > On Jun 1, 2012, at 12:35 PM, Darryle Steplight wrote: >> @Rob - That looks like some solid info and methods. I haven't used >> APC before but I definitely see where it can come in handy. I always >> wonder how Facebook did it too. Thanks for the info. 6 slides from the end, labeled "Sitevars": http://www.scribd.com/doc/88689/ApcFacebook Some of their engineers have mentioned it in the fb engineering blog or on quora but I can't find it right now. Their engineering blog is here which has lots of great posts: https://www.facebook.com/Engineering?sk=notes From dsteplight at gmail.com Fri Jun 1 13:35:18 2012 From: dsteplight at gmail.com (Darryle Steplight) Date: Fri, 1 Jun 2012 13:35:18 -0400 Subject: [nycphp-talk] Which deployment apps are you using? In-Reply-To: <8405364077888079087@unknownmsgid> References: <859A8841-E4AA-44D4-B656-BC34C4AF2851@beaffinitive.com> <8405364077888079087@unknownmsgid> Message-ID: Thanks Federico, reading that was a lot faster than this long video I saw last year where Facebook explained their lLAMP stack. http://www.infoq.com/presentations/Facebook-Software-Stack On Fri, Jun 1, 2012 at 1:13 PM, federico ulfo wrote: > Well here's the Facebook structure > http://www.quora.com/What-is-Facebooks-architecture > > Believe it or not the base code is still PHP, compiled to HH ByteCode, > but yet they write PHP :) > > Sent from my iPhone > > On Jun 1, 2012, at 12:35 PM, Darryle Steplight wrote: > >> @Chris- At the very least, everyone should probably be using some sort >> of version control and SSH. If I have a choice I would prefer to use >> git though even though I'm stuck using SVN for a few projects I'm >> working on. >> >> @Rob - ?That looks like some solid info and methods. I haven't used >> APC before but I definitely see where it can come in handy. I always >> wonder how Facebook did it too. Thanks for the info. >> >> On Fri, Jun 1, 2012 at 12:23 PM, Rob Marscher >> wrote: >>> >>>> On Fri, Jun 1, 2012 at 12:10 PM, Darryle Steplight wrote: >>>>> ? ?I just heard of Capistrano, but in the past I've used Ant when I >>>>> was using Eclipse for my IDE and working with JSP back in 07. What are >>>>> the best deployment softwares for PHP? Which ones are the easiest to >>>>> get up and running quickly? Which do you prefer to use at the job? >>> >>> I'm using a hand-rolled method that uses parallel-ssh to simultaneously update servers, combined with custom php code for handling migrations, and git tags for managing releases and allowing to roll back (assuming there aren't major migrations that would prevent roll back). >>> >>> Facebook puts conditional checks all over their code for different features. ?Enabled features are cached in APC. ?They have a private url/api for enabling/disabling features by updating the APC cache keys. ?That way they can roll out code changes without it actually going live and the test features in production selectively on certain servers. >>> >>> Here's how Etsy does it: >>> http://codeascraft.etsy.com/2010/05/20/quantum-of-deployment/ >>> >>> Here's a php based deploy method created by Rasmus: http://blog.wepay.com/2010/11/30/weploy-wepays-deployment-tool/ >>> >>> >>> _______________________________________________ >>> New York PHP User Group Community Talk Mailing List >>> http://lists.nyphp.org/mailman/listinfo/talk >>> >>> http://www.nyphp.org/show-participation >> >> >> >> -- >> ---------------------------------------------- >> "May the Source be with you." >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show-participation > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation -- ---------------------------------------------- "May the Source be with you." From dsteplight at gmail.com Fri Jun 1 13:37:58 2012 From: dsteplight at gmail.com (Darryle Steplight) Date: Fri, 1 Jun 2012 13:37:58 -0400 Subject: [nycphp-talk] Which deployment apps are you using? In-Reply-To: <72662A35-D814-4CE8-87F8-E2463AFF85DA@beaffinitive.com> References: <859A8841-E4AA-44D4-B656-BC34C4AF2851@beaffinitive.com> <8405364077888079087@unknownmsgid> <72662A35-D814-4CE8-87F8-E2463AFF85DA@beaffinitive.com> Message-ID: @Rob, I can't believe I never read that blog before. Looks like they have some interesting posts. I'm going to have to take some time tonight to check this out. This is definitely going in my Delicious stack though. On Fri, Jun 1, 2012 at 1:32 PM, Rob Marscher wrote: > >> On Jun 1, 2012, at 12:35 PM, Darryle Steplight wrote: >>> @Rob - ?That looks like some solid info and methods. I haven't used >>> APC before but I definitely see where it can come in handy. I always >>> wonder how Facebook did it too. Thanks for the info. > > 6 slides from the end, labeled "Sitevars": > http://www.scribd.com/doc/88689/ApcFacebook > > Some of their engineers have mentioned it in the fb engineering blog or on quora but I can't find it right now. ?Their engineering blog is here which has lots of great posts: https://www.facebook.com/Engineering?sk=notes > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation -- ---------------------------------------------- "May the Source be with you." From ronald.bradford at gmail.com Fri Jun 1 16:00:02 2012 From: ronald.bradford at gmail.com (Ronald Bradford) Date: Fri, 1 Jun 2012 16:00:02 -0400 Subject: [nycphp-talk] Which deployment apps are you using? In-Reply-To: <72662A35-D814-4CE8-87F8-E2463AFF85DA@beaffinitive.com> References: <859A8841-E4AA-44D4-B656-BC34C4AF2851@beaffinitive.com> <8405364077888079087@unknownmsgid> <72662A35-D814-4CE8-87F8-E2463AFF85DA@beaffinitive.com> Message-ID: You should definitely add http://www.facebook.com/MySQLatFacebook to that list to read. Facebook has some of the top engineers in the world on staff (and continue to add to this). Their work in scalability within the MySQL community is well known. While there is a lot to digest here, even at a technical level for a MySQL Expert, it is great to see what they do and what they add to open source. Ronald On Fri, Jun 1, 2012 at 1:32 PM, Rob Marscher wrote: > > > On Jun 1, 2012, at 12:35 PM, Darryle Steplight > wrote: > >> @Rob - That looks like some solid info and methods. I haven't used > >> APC before but I definitely see where it can come in handy. I always > >> wonder how Facebook did it too. Thanks for the info. > > 6 slides from the end, labeled "Sitevars": > http://www.scribd.com/doc/88689/ApcFacebook > > Some of their engineers have mentioned it in the fb engineering blog or on > quora but I can't find it right now. Their engineering blog is here which > has lots of great posts: https://www.facebook.com/Engineering?sk=notes > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dsteplight at gmail.com Fri Jun 1 16:09:28 2012 From: dsteplight at gmail.com (Darryle Steplight) Date: Fri, 1 Jun 2012 16:09:28 -0400 Subject: [nycphp-talk] Which deployment apps are you using? In-Reply-To: References: <859A8841-E4AA-44D4-B656-BC34C4AF2851@beaffinitive.com> <8405364077888079087@unknownmsgid> <72662A35-D814-4CE8-87F8-E2463AFF85DA@beaffinitive.com> Message-ID: @Ronald - That page is awesome. One of the first messages I saw was "This will be excellent. I learn a lot from Baron -- Mark " . Baron has always given good advice. I'll add this to the list for sure. Thanks. On Fri, Jun 1, 2012 at 4:00 PM, Ronald Bradford wrote: > You should definitely add?http://www.facebook.com/MySQLatFacebook ?to that > list to read. > Facebook has some of the top engineers in the world on staff (and continue > to add to this). > Their work in scalability within the MySQL community is well known. > > While there is a lot to digest here, even at a technical level for a MySQL > Expert, it is great to see what they do and what they add to open source. > > Ronald > > > On Fri, Jun 1, 2012 at 1:32 PM, Rob Marscher > wrote: >> >> >> > On Jun 1, 2012, at 12:35 PM, Darryle Steplight >> > wrote: >> >> @Rob - ?That looks like some solid info and methods. I haven't used >> >> APC before but I definitely see where it can come in handy. I always >> >> wonder how Facebook did it too. Thanks for the info. >> >> 6 slides from the end, labeled "Sitevars": >> http://www.scribd.com/doc/88689/ApcFacebook >> >> Some of their engineers have mentioned it in the fb engineering blog or on >> quora but I can't find it right now. ?Their engineering blog is here which >> has lots of great posts: https://www.facebook.com/Engineering?sk=notes >> >> >> >> _______________________________________________ >> New York PHP User Group Community Talk Mailing List >> http://lists.nyphp.org/mailman/listinfo/talk >> >> http://www.nyphp.org/show-participation > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation -- ---------------------------------------------- "May the Source be with you." From danielc at analysisandsolutions.com Fri Jun 1 17:41:47 2012 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Fri, 1 Jun 2012 17:41:47 -0400 Subject: [nycphp-talk] Which deployment apps are you using? In-Reply-To: References: Message-ID: <20120601214147.GA20316@analysisandsolutions.com> Hey Folks: On Fri, Jun 01, 2012 at 12:13:25PM -0400, Chris Snyder wrote: > Subversion and SSH here. Seconded. Plus some shell scripts. Though I'm now planning out a deployment system using git post-update hook scripts. Use your favorite search engine to read more about it. Once I have my ideas sorted out and working, I'll post them. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 From danielc at analysisandsolutions.com Fri Jun 1 21:28:07 2012 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Fri, 1 Jun 2012 21:28:07 -0400 Subject: [nycphp-talk] What PHP tools are you using? In-Reply-To: <48F6EC15-CEA5-4888-A344-CD9EAD4B9DD6@beaffinitive.com> References: <48F6EC15-CEA5-4888-A344-CD9EAD4B9DD6@beaffinitive.com> Message-ID: <20120602012807.GA22998@analysisandsolutions.com> Heya: On Tue, May 29, 2012 at 09:57:03PM -0400, Rob Marscher wrote: > On May 29, 2012, at 6:33 PM, Ronald Bradford wrote: > > Never used an IDE for PHP, I don't see the purpose, happy for an explanation why I should? > > Autocomplete and context based documentation of your own methods is > pretty helpful. > > Being able to jump around files in a large project by highlighing a > class name and hitting a function key is nice. > > Also, the on-the-fly syntax checking can be helpful. All of which can be done in Vim via plugins and magic incantations in your configuration files. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 From zippy1981 at gmail.com Mon Jun 4 10:21:00 2012 From: zippy1981 at gmail.com (Justin Dearing) Date: Mon, 4 Jun 2012 10:21:00 -0400 Subject: [nycphp-talk] Is there a list of limitations of mssql_foo() or ntwdblib.dll? Message-ID: Hey, My reasons for wanting this are literally academic. I'm writing a chapter in a book about the new sqlsrv_* driver, so I'd like to cite a list of concrete reasons not to use mssql_*. I've found this list, which is for the perl wrapper to ntwdblib.dll: http://www.sommarskog.se/mssqlperl/sphinx.html So in terms of actual limitations: - You can only get error messages with , mssql_get_last_message() not the SQL or ODBC codes like sqlsrv_errors() - The mssql_ driver does not support unicode (nchar/nvarchar/ntext) - You can't pass input parameters to function that are CLR (.NET) data types I can list those three reasons in the book, and possible cite the above link. But can anyone provide a link to limitations of ntwdblib.dll that is PHP centric? Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: From yitzchak.schaffer at gmx.com Tue Jun 5 10:25:29 2012 From: yitzchak.schaffer at gmx.com (Yitzchak Schaffer) Date: Tue, 05 Jun 2012 10:25:29 -0400 Subject: [nycphp-talk] Which deployment apps are you using? In-Reply-To: References: Message-ID: <4FCE16D9.3070901@gmx.com> On 6/1/2012 12:10 PM, Darryle Steplight wrote: > I just heard of Capistrano, but in the past I've used Ant when I > was using Eclipse for my IDE and working with JSP back in 07. What are > the best deployment softwares for PHP? Which ones are the easiest to > get up and running quickly? Which do you prefer to use at the job? > I've used puppet plus git in the past, when I was responsible for deployment. We had only one box, so I suppose one could consider it overkill, but it was great for ensuring that dev, staging, and prod environments were set up correctly. -- Yitzchak Schaffer From eugenio at favoriti.it Fri Jun 8 04:03:16 2012 From: eugenio at favoriti.it (Eugenio) Date: Fri, 8 Jun 2012 10:03:16 +0200 Subject: [nycphp-talk] UTF-8, databases and best practices In-Reply-To: <00a901cd3909$0cb9bb40$262d31c0$@zaunere.com> References: <00a901cd3909$0cb9bb40$262d31c0$@zaunere.com> Message-ID: 2012/5/23 Hans Zaunere I'd be interested to hear other's thoughts, but the general consensus these > days is "convert all to UTF-8". Is there an application-requirement-reason > that you'd need to convert data to a different charset at different times? > > In general: > > 1. Raw data (any charset/encoding) > 2. Detect and convert to UTF 8, clean-up, etc. > 3. Store in database/etc > 4. Read/display in UTF 8 > ** If you have already received this message: sorry, I had problems posting here with gmail and I couldn't realize if my message was correctly posted, so I'm trying again with another email ** Hi all and thanks for the interesting answers! The problem 2) is still the one I'm not completely sure about; in almost all your answers you suppose I can decide how to setup the database but it is not the case. This application has to work with any database settings, I can't force the users to ALTER the database charset and make it UTF-8. So should I have to read and convert on the fly (using PHP ICONV) to UTF-8 from the database and then convert it back again before writing? I can't just assume to work with UTF-8, right? Thanks again. Eugenio -------------------- DaDaBIK - Database Interfaces Kreator http://www.dadabik.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From rainelemental at gmail.com Sun Jun 10 12:48:26 2012 From: rainelemental at gmail.com (Federico Ulfo) Date: Sun, 10 Jun 2012 12:48:26 -0400 Subject: [nycphp-talk] Hack Social, tomorrow meetup Message-ID: Hey dudes, tomorrow we'll go nuts hacking and talking about NYC startups and their technology around PHP, meet with us at Suspenders for the Hack Social meetup. Bring your laptop, grab a beer, and have fun. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dsteplight at gmail.com Sun Jun 10 15:51:24 2012 From: dsteplight at gmail.com (Darryle Steplight) Date: Sun, 10 Jun 2012 15:51:24 -0400 Subject: [nycphp-talk] Hack Social, tomorrow meetup In-Reply-To: References: Message-ID: I'm upset I won't be able to make this one. I'll catch you guys the next time around though. On Sun, Jun 10, 2012 at 12:48 PM, Federico Ulfo wrote: > Hey dudes, > tomorrow we'll go nuts hacking and talking about NYC startups and their > technology around PHP, meet with us at?Suspenders?for the?Hack > Social?meetup. Bring your laptop, grab a beer, and have fun. > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation -- ---------------------------------------------- "May the Source be with you." From rainelemental at gmail.com Mon Jun 11 16:50:29 2012 From: rainelemental at gmail.com (Federico Ulfo) Date: Mon, 11 Jun 2012 16:50:29 -0400 Subject: [nycphp-talk] Hack Social, tomorrow meetup In-Reply-To: References: Message-ID: Guys, just as reminder, we are meeting for Hack Social, Today at 6.30PM at Suspenders in 111 Brodway, Manhattan. We also just open 10 more spot for the last minute hackers. See you there in a bit. On Sun, Jun 10, 2012 at 3:51 PM, Darryle Steplight wrote: > I'm upset I won't be able to make this one. I'll catch you guys the > next time around though. > > On Sun, Jun 10, 2012 at 12:48 PM, Federico Ulfo > wrote: > > Hey dudes, > > tomorrow we'll go nuts hacking and talking about NYC startups and their > > technology around PHP, meet with us at Suspenders for the Hack > > Social meetup. Bring your laptop, grab a beer, and have fun. > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show-participation > > > > -- > ---------------------------------------------- > "May the Source be with you." > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rainelemental at gmail.com Tue Jun 12 16:18:13 2012 From: rainelemental at gmail.com (Federico Ulfo) Date: Tue, 12 Jun 2012 16:18:13 -0400 Subject: [nycphp-talk] Hacker Anonymous (Hack Social II) Message-ID: Guys, I have scheduled a new Hack Social event for Monday 18, at 6.30 at Suspenders . The subject it will be: Agile and Continuous Delivery. We'll use the projector to show how to install Jenkins, Phing, Git, phpcs, phpcpd, phpDepend, phpmd, phpunit. If you guys have experience with one or more of those tools, you are welcome to join us to show how to install and use them. Yesterday was very fun, so for who wasn't there, here's explained what is Hack Social: > > The startup vibe in New York is hypo, there are hundreds of tech events. > I've been going in ALL of them (seriously) and I met fellows of any type, > VC and mostly entrepreneurs, Ruby, Python, Earlang, C, Java and Javascript > developers, but ... Hey where the hell are all the PHP developers?!? Well, > the question is pretty simple, we are all busy working, and that's good > right!?! > The only meetups where I've found PHP developers are the PHP and MySql > meetups, but you may agree with me, they are about some dude that talks for > an hour about something boring, and after that you don't have much time to > connect with the other developers. > I start to feel the needs to get in touch with other PHP fellows to share > work experience about services, servers and tools but especially to hack > them together. So I've contacted Hans... and that's how Hack Social born! Thanks to Andrew for teaching us how to use and configure jMeter, and thanks to all the other fellows for participating. See you soon. -------------- next part -------------- An HTML attachment was scrubbed... URL: From leamhall at gmail.com Sat Jun 16 10:57:17 2012 From: leamhall at gmail.com (Leam Hall) Date: Sat, 16 Jun 2012 10:57:17 -0400 Subject: [nycphp-talk] Could use some PHP critique on my project Message-ID: <4FDC9ECD.1010306@gmail.com> If you're bored, that is. Not if you're depressed though, you'd probably go "Oh my goodness I can't stand it anymore!" and do something drastic like eating an entire Whitman's Sampler. The project is a dive planner for technical scuba dives. There are some formulas and reference arrays but everything is fairly simple. You don't have to know scuba diving to provide feedback; at this point I'm looking for criticism on how to improve the code itself. The ideal response would be something like: "You really need to work on X. Check out www.example.com/How_to_do_X". https://sourceforge.net/p/techdiveplanner I appreciate any feedback you provide. There's a forum there or you can e-mail me directly. Thanks! Leam From hans at cyberxdesigns.com Sat Jun 16 11:05:22 2012 From: hans at cyberxdesigns.com (Hans C. Kaspersetz) Date: Sat, 16 Jun 2012 11:05:22 -0400 Subject: [nycphp-talk] Could use some PHP critique on my project In-Reply-To: <4FDC9ECD.1010306@gmail.com> References: <4FDC9ECD.1010306@gmail.com> Message-ID: <7C1B11C6-DE1B-4936-AB87-6E55761E8EFC@cyberxdesigns.com> On Jun 16, 2012, at 10:57 AM, Leam Hall wrote: > If you're bored, that is. Not if you're depressed though, you'd probably go "Oh my goodness I can't stand it anymore!" and do something drastic like eating an entire Whitman's Sampler. > > The project is a dive planner for technical scuba dives. There are some formulas and reference arrays but everything is fairly simple. You don't have to know scuba diving to provide feedback; at this point I'm looking for criticism on how to improve the code itself. > > The ideal response would be something like: > > "You really need to work on X. Check out www.example.com/How_to_do_X". > > https://sourceforge.net/p/techdiveplanner > > I appreciate any feedback you provide. There's a forum there or you can e-mail me directly. > > Thanks! Leam, I know a little about technical diving and coding (http://quietdiver.com). I will take a look over the weekend. Hans Kaspersetz Cyber X Designs http://cyberxdesigns.com Sent from my tricorder From leamhall at gmail.com Sat Jun 16 11:44:00 2012 From: leamhall at gmail.com (Leam Hall) Date: Sat, 16 Jun 2012 11:44:00 -0400 Subject: [nycphp-talk] Could use some PHP critique on my project In-Reply-To: <7C1B11C6-DE1B-4936-AB87-6E55761E8EFC@cyberxdesigns.com> References: <4FDC9ECD.1010306@gmail.com> <7C1B11C6-DE1B-4936-AB87-6E55761E8EFC@cyberxdesigns.com> Message-ID: <4FDCA9C0.1010305@gmail.com> On 06/16/2012 11:05 AM, Hans C. Kaspersetz wrote: > Leam, > > I know a little about technical diving and coding (http://quietdiver.com). I will take a look over the weekend. > > Hans Kaspersetz > Cyber X Designs > http://cyberxdesigns.com Hans, thanks! I just did IANTD Intro to Cave and Side-mount, working on Adv Nitrox and Deep. That's why I made the page, I keep forgetting the formulas. :) Leam From ramons at gmx.net Sat Jun 16 14:13:33 2012 From: ramons at gmx.net (David Krings) Date: Sat, 16 Jun 2012 14:13:33 -0400 Subject: [nycphp-talk] Could use some PHP critique on my project In-Reply-To: <4FDC9ECD.1010306@gmail.com> References: <4FDC9ECD.1010306@gmail.com> Message-ID: <4FDCCCCD.4090806@gmx.net> On 6/16/2012 10:57 AM, Leam Hall wrote: > If you're bored, that is. Not if you're depressed though, you'd probably go > "Oh my goodness I can't stand it anymore!" and do something drastic like > eating an entire Whitman's Sampler. I eat an entire Whitman's sampler even when I am not depressed. But are you looking for code review or application QA? I can give you some QA / UX feedback, for code review I am rather useless. David From leamhall at gmail.com Sat Jun 16 15:03:42 2012 From: leamhall at gmail.com (Leam Hall) Date: Sat, 16 Jun 2012 15:03:42 -0400 Subject: [nycphp-talk] Could use some PHP critique on my project In-Reply-To: <4FDCCCCD.4090806@gmx.net> References: <4FDC9ECD.1010306@gmail.com> <4FDCCCCD.4090806@gmx.net> Message-ID: <4FDCD88E.9050100@gmail.com> On 06/16/2012 02:13 PM, David Krings wrote: > I eat an entire Whitman's sampler even when I am not depressed. But are > you looking for code review or application QA? I can give you some QA / > UX feedback, for code review I am rather useless. > > David David, My weakness is ice cream. Depressed or not it doesn't last long here. I'm looking for whatever feedback you can provide. There are a lot of talents that go into making an application "good" and I'm a newbie at most of them. Thanks! Leam From leamhall at gmail.com Sun Jun 17 11:56:03 2012 From: leamhall at gmail.com (Leam Hall) Date: Sun, 17 Jun 2012 11:56:03 -0400 Subject: [nycphp-talk] David Sklar, et al Message-ID: <4FDDFE13.1030006@gmail.com> One of the NYPHP members has provided some feedback on my Technical Dive Planner and he noted that I might have read an OnLAMP article by David Sklar. http://onlamp.com/pub/a/php/2004/08/26/PHPformhandling.html I replied that I had. What would have been a more appropriate response is "Yes! I start to panic every time I think about coding a PHP form and can't find one of the printed copies of the article with my highlights on it." Didn't really want to freak them out though so I kept my response a bit more sane. I do, however, want to thank David, Adam, and Chris for their books and the NYPHP community for NYPHP.org. I'm not sure you all realize how much better you have made things for some of us. Leam From danielc at analysisandsolutions.com Wed Jun 20 16:10:45 2012 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Wed, 20 Jun 2012 16:10:45 -0400 Subject: [nycphp-talk] Which deployment apps are you using? In-Reply-To: <20120601214147.GA20316@analysisandsolutions.com> References: <20120601214147.GA20316@analysisandsolutions.com> Message-ID: <20120620201045.GA14198@analysisandsolutions.com> Howdy: On Fri, Jun 01, 2012 at 05:41:47PM -0400, Daniel Convissor wrote: > > Though I'm now planning out a > deployment system using git post-update hook scripts. Use your favorite > search engine to read more about it. Once I have my ideas sorted out > and working, I'll post them. I'm excited to have worked out a system of Git hooks and associated scripts that work pretty well. Please check them out (no pun intended) and let me know what you think. https://github.com/convissor/git_push_deployer I have some additional stuff for pushing and pulling WordPress sites in particular, though handy for database driven sites in general, which I hope to make public in the near future. Thanks, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 From dsteplight at gmail.com Thu Jun 21 15:43:02 2012 From: dsteplight at gmail.com (Darryle Steplight) Date: Thu, 21 Jun 2012 15:43:02 -0400 Subject: [nycphp-talk] How To Make "php" show up as "somefile" when running the top command... Message-ID: Hi Guys, How do i get my PHP file running from the command line to show up as "SOMENAME" when I execute the top command from the terminal? Right now it will show up as "php" but I want to be able to distinguish it from other php files that may be running. I've seen this done once so I know it's possible. I'm not sure if this is the right list to ask but I thought it would be worth a shot. -- ---------------------------------------------- "May the Source be with you." From bulk at zaunere.com Thu Jun 21 16:42:36 2012 From: bulk at zaunere.com (Hans Zaunere) Date: Thu, 21 Jun 2012 16:42:36 -0400 Subject: [nycphp-talk] How To Make "php" show up as "somefile" when running the top command... In-Reply-To: References: Message-ID: > ? ? How do i get my PHP file running from the command line to show up > as "SOMENAME" when I execute the top command from the terminal? Right > now it will show up as "php" but I want to be able to distinguish it > from other php ?files that may be running. I've seen this done once so > I know it's possible. I'm not sure if this is the right list to ask > but I thought it would be worth a shot. proctitle pecl extension is probably what you want, though read this: https://bugs.php.net/bug.php?id=29479 Though in any case, running php yourscript.php should show up as it's called in top/ps. H From dsteplight at gmail.com Thu Jun 21 16:49:28 2012 From: dsteplight at gmail.com (Darryle Steplight) Date: Thu, 21 Jun 2012 16:49:28 -0400 Subject: [nycphp-talk] How To Make "php" show up as "somefile" when running the top command... In-Reply-To: References: Message-ID: Hi Hans, When I run any php file from the command line it shows up at "php" under the COMMAND column on my Mac. I'm not running this on a server right now, just locally. On Thu, Jun 21, 2012 at 4:42 PM, Hans Zaunere wrote: >> ? ? How do i get my PHP file running from the command line to show up >> as "SOMENAME" when I execute the top command from the terminal? Right >> now it will show up as "php" but I want to be able to distinguish it >> from other php ?files that may be running. I've seen this done once so >> I know it's possible. I'm not sure if this is the right list to ask >> but I thought it would be worth a shot. > > proctitle pecl extension is probably what you want, though read this: > > https://bugs.php.net/bug.php?id=29479 > > Though in any case, running php yourscript.php should show up as it's > called in top/ps. > > H > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation -- ---------------------------------------------- "May the Source be with you." From bulk at zaunere.com Thu Jun 21 16:52:22 2012 From: bulk at zaunere.com (Hans Zaunere) Date: Thu, 21 Jun 2012 16:52:22 -0400 Subject: [nycphp-talk] How To Make "php" show up as "somefile" when running the top command... In-Reply-To: References: Message-ID: > ? ? When I run any php file from the command line it shows up at > "php" under the COMMAND column on my Mac. I'm not running this on a > server right now, just locally. Oh, Mac... In theory there's BSD under there somewhere, but I don't know what they've done to it. I'd imagine the COMMAND column in Mac pulls from ps or top but it's hard to say. You could drop to command line and try top/ps to at first know if the process name is being changed as far as the OS sees it. Then the Mac GUI is another question :) H From dsteplight at gmail.com Thu Jun 21 16:59:27 2012 From: dsteplight at gmail.com (Darryle Steplight) Date: Thu, 21 Jun 2012 16:59:27 -0400 Subject: [nycphp-talk] How To Make "php" show up as "somefile" when running the top command... In-Reply-To: References: Message-ID: Hans, Using the "ps" command allows me to see "php filename.php" but top wouldn't allow me to see the filename, this is what sparked me to think about changing "php" to something more specific. I don't know why I didn't try "ps" at first. A little birdy told me that symlinking to the PHP binary will allow you to change "php" to whatever you use in your symlink. Makes sense to me, but using ps will suffice for now. On Thu, Jun 21, 2012 at 4:52 PM, Hans Zaunere wrote: >> ? ? When I run any php file from the command line it shows up at >> "php" under the COMMAND column on my Mac. I'm not running this on a >> server right now, just locally. > > Oh, Mac... > > In theory there's BSD under there somewhere, but I don't know what > they've done to it. ?I'd imagine the COMMAND column in Mac pulls from > ps or top but it's hard to say. ?You could drop to command line and > try top/ps to at first know if the process name is being changed as > far as the OS sees it. ?Then the Mac GUI is another question :) > > H > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation -- ---------------------------------------------- "May the Source be with you." From danielc at analysisandsolutions.com Thu Jun 21 18:55:00 2012 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Thu, 21 Jun 2012 18:55:00 -0400 Subject: [nycphp-talk] How To Make "php" show up as "somefile" when running the top command... In-Reply-To: References: Message-ID: <20120621225500.GA31563@analysisandsolutions.com> Hi Darryle: > Using the "ps" command allows me to see "php filename.php" but top > wouldn't allow me to see the filename Try htop. For top, you may be able to adjust the configuration file to get what you want. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 From rotsen at gmail.com Thu Jun 21 18:56:57 2012 From: rotsen at gmail.com (=?ISO-8859-1?B?TulzdG9y?=) Date: Thu, 21 Jun 2012 15:56:57 -0700 Subject: [nycphp-talk] How To Make "php" show up as "somefile" when running the top command... In-Reply-To: References: Message-ID: Can you find the php executable that you are using and crate an alias and put it on your .xxxrc file on the bsd system. O n my linux I put an alias line on my .bashrc file: alias vim='/usr/sbin/gvim' I hope this works for you. Nestor :-) On Thu, Jun 21, 2012 at 1:59 PM, Darryle Steplight wrote: > Hans, > > Using the "ps" command allows me to see "php filename.php" but top > wouldn't allow me to see the filename, this is what sparked me to > think about changing "php" to something more specific. I don't know > why I didn't try "ps" at first. > > A little birdy told me that symlinking to the PHP binary will allow > you to change "php" to whatever you use in your symlink. Makes sense > to me, but using ps will suffice for now. > > On Thu, Jun 21, 2012 at 4:52 PM, Hans Zaunere wrote: > >> When I run any php file from the command line it shows up at > >> "php" under the COMMAND column on my Mac. I'm not running this on a > >> server right now, just locally. > > > > Oh, Mac... > > > > In theory there's BSD under there somewhere, but I don't know what > > they've done to it. I'd imagine the COMMAND column in Mac pulls from > > ps or top but it's hard to say. You could drop to command line and > > try top/ps to at first know if the process name is being changed as > > far as the OS sees it. Then the Mac GUI is another question :) > > > > H > > _______________________________________________ > > New York PHP User Group Community Talk Mailing List > > http://lists.nyphp.org/mailman/listinfo/talk > > > > http://www.nyphp.org/show-participation > > > > -- > ---------------------------------------------- > "May the Source be with you." > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidalanroth at gmail.com Sun Jun 24 08:51:15 2012 From: davidalanroth at gmail.com (David Roth) Date: Sun, 24 Jun 2012 08:51:15 -0400 Subject: [nycphp-talk] Can't do PHP 'exec' for an rsync command via web server Message-ID: I'm developing a small utility web page to run on my own server which is running CentOS 6.2 and Apache. PHP 5.3.3. I tried using from PHP the exec function and also system, but after checking the results nothing is returned. However, when I ran a little fragment of this PHP code from the command line, it worked fine. But it won't execute and return anything when run from a web page. I have searched for an answer and have not been able to find a workable solution to this. I looked and Safe Mode is off for PHP, as it is shipped with CentOS. I've see forum postings about having Apache run as root, but that's not secure. I was wondering if it was possible to put some specific commands in sudoers like rsync for apache? That way maybe exec('sudo rsync ...'); would work without promoting for a password? I'd greatly appreciate a solution from someone who has already been through this. Thanks! David Roth -------------- next part -------------- An HTML attachment was scrubbed... URL: From rakics at gmail.com Sun Jun 24 10:21:13 2012 From: rakics at gmail.com (Sasa Rakic - Gmail) Date: Sun, 24 Jun 2012 16:21:13 +0200 Subject: [nycphp-talk] Can't do PHP 'exec' for an rsync command via web server In-Reply-To: References: Message-ID: <006001cd5214$9cb16f30$d6144d90$@gmail.com> Hi David, I do not have installed Linux on my computer, maybe this link should help: https://www.centos.org/modules/newbb/viewtopic.php?topic_id=36419 Best Regards, Sasa From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of David Roth Sent: Sunday, June 24, 2012 2:51 PM To: NYPHP Talk Subject: [nycphp-talk] Can't do PHP 'exec' for an rsync command via web server I'm developing a small utility web page to run on my own server which is running CentOS 6.2 and Apache. PHP 5.3.3. I tried using from PHP the exec function and also system, but after checking the results nothing is returned. However, when I ran a little fragment of this PHP code from the command line, it worked fine. But it won't execute and return anything when run from a web page. I have searched for an answer and have not been able to find a workable solution to this. I looked and Safe Mode is off for PHP, as it is shipped with CentOS. I've see forum postings about having Apache run as root, but that's not secure. I was wondering if it was possible to put some specific commands in sudoers like rsync for apache? That way maybe exec('sudo rsync ...'); would work without promoting for a password? I'd greatly appreciate a solution from someone who has already been through this. Thanks! David Roth -------------- next part -------------- An HTML attachment was scrubbed... URL: From bulk at zaunere.com Sun Jun 24 11:50:24 2012 From: bulk at zaunere.com (Hans Zaunere) Date: Sun, 24 Jun 2012 11:50:24 -0400 Subject: [nycphp-talk] Can't do PHP 'exec' for an rsync command via web server In-Reply-To: References: Message-ID: > I'm developing a small utility web page to run on my own server which is > running CentOS 6.2 and Apache.?PHP 5.3.3. > > I tried using from PHP the exec function and also system, but after checking > the results nothing is returned. However, when I ran a little fragment of > this PHP code from the command line, it worked fine. But it won't execute > and return anything when run from a web page. > > I have searched for an answer and have not been able to find a workable > solution to this. I looked and Safe Mode is off for PHP, as it is shipped > with CentOS.?I've see forum postings about having Apache run as root, but > that's not secure. I was wondering if it was possible to put some specific > commands in sudoers like rsync for apache? That way maybe exec('sudo rsync > ...'); would work without promoting for a password? > > I'd greatly appreciate a solution from someone who has already been through > this. Thanks! Not necessarily a straightforward resolution to this, but some things to keep in mind: - ensure that the CLI and Apache versions of PHP are using the same php.ini and that they're logging to the same (or atleast some place that you know) - confirm that the logs don't confirm errors - use output buffering and system() to execute a command and debug what it returns - permissions are probably a concern which should be reflected in the above output Hopefully that helps a bit :) H From rolan at omnistep.com Sun Jun 24 13:50:52 2012 From: rolan at omnistep.com (Rolan Yang) Date: Sun, 24 Jun 2012 13:50:52 -0400 Subject: [nycphp-talk] Can't do PHP 'exec' for an rsync command via web server In-Reply-To: References: Message-ID: <4FE7537C.9040300@omnistep.com> try specifying the entire path to /usr/bin/rsync in your exec command line. ~Rolan On 6/24/2012 8:51 AM, David Roth wrote: > I'm developing a small utility web page to run on my own server which > is running CentOS 6.2 and Apache. PHP 5.3.3. > > I tried using from PHP the exec function and also system, but after > checking the results nothing is returned. However, when I ran a little > fragment of this PHP code from the command line, it worked fine. But > it won't execute and return anything when run from a web page. > > I have searched for an answer and have not been able to find a > workable solution to this. I looked and Safe Mode is off for PHP, as > it is shipped with CentOS. I've see forum postings about having Apache > run as root, but that's not secure. I was wondering if it was possible > to put some specific commands in sudoers like rsync for apache? That > way maybe exec('sudo rsync ...'); would work without promoting for a > password? > > I'd greatly appreciate a solution from someone who has already been > through this. Thanks! > > David Roth > > > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidalanroth at gmail.com Sun Jun 24 18:52:01 2012 From: davidalanroth at gmail.com (David Roth) Date: Sun, 24 Jun 2012 18:52:01 -0400 Subject: [nycphp-talk] Can't do PHP 'exec' for an rsync command via web server In-Reply-To: References: Message-ID: On Sun, Jun 24, 2012 at 11:50 AM, Hans Zaunere wrote: > > I'm developing a small utility web page to run on my own server which is > > running CentOS 6.2 and Apache. PHP 5.3.3. > > > > I tried using from PHP the exec function and also system, but after > checking > > the results nothing is returned. However, when I ran a little fragment of > > this PHP code from the command line, it worked fine. But it won't execute > > and return anything when run from a web page. > > > > I have searched for an answer and have not been able to find a workable > > solution to this. I looked and Safe Mode is off for PHP, as it is shipped > > with CentOS. I've see forum postings about having Apache run as root, but > > that's not secure. I was wondering if it was possible to put some > specific > > commands in sudoers like rsync for apache? That way maybe exec('sudo > rsync > > ...'); would work without promoting for a password? > > > > I'd greatly appreciate a solution from someone who has already been > through > > this. Thanks! > > > Not necessarily a straightforward resolution to this, but some things > to keep in mind: > > - ensure that the CLI and Apache versions of PHP are using the same > php.ini and that they're logging to the same (or atleast some place > that you know) > > - confirm that the logs don't confirm errors > > - use output buffering and system() to execute a command and debug > what it returns > > - permissions are probably a concern which should be reflected in the > above output > > Hopefully that helps a bit :) > > H > Thanks for the suggestions. The plot thickens. :-) I decided to have system() execute a shell script to do the rsync to see what happens. In the shell script I have 2>rsync_results to capture what is going on. system() was returning 255: Could not create directory '/var/www/.ssh'. Host key verification failed. rsync: connection unexpectedly closed (0 bytes received so far) [receiver] rsync error: unexplained error (code 255) at io.c(600) [receiver=3.0.6] I also added this to the last line of the sudoers file: apache ALL=(ALL) NOPASSWD: ALL Yes, I know that's not secure and it should just be for the rsync command only, but I tried that first to see if it made any difference at all, but it doesn't. The rsync error output of "Could not create directory '/var/www/.ssh'." to me at least reveals that the Apache server doesn't have root access and is operating as user apache, not root. Is my sudoers file wrong? Keep in mind, if I run this shell script from the command line as root, it works. If I run the php script from the command line as root it also works. There is no .ssh in /var/www/.ssh nor should there be. The .ssh for root is located in /root. It appears this has to do with permissions, but I'm not sure how to do this properly. Thanks! David Roth -------------- next part -------------- An HTML attachment was scrubbed... URL: From bulk at zaunere.com Sun Jun 24 19:06:58 2012 From: bulk at zaunere.com (Hans Zaunere) Date: Sun, 24 Jun 2012 19:06:58 -0400 Subject: [nycphp-talk] Can't do PHP 'exec' for an rsync command via web server In-Reply-To: References: Message-ID: Often the Apache user isn't created with a home directory etc. Check the passwd file to ensure its a full user with a home and shell? Security is another question :) On Jun 24, 2012 6:52 PM, "David Roth" wrote: > > > On Sun, Jun 24, 2012 at 11:50 AM, Hans Zaunere wrote: > >> > I'm developing a small utility web page to run on my own server which is >> > running CentOS 6.2 and Apache. PHP 5.3.3. >> > >> > I tried using from PHP the exec function and also system, but after >> checking >> > the results nothing is returned. However, when I ran a little fragment >> of >> > this PHP code from the command line, it worked fine. But it won't >> execute >> > and return anything when run from a web page. >> > >> > I have searched for an answer and have not been able to find a workable >> > solution to this. I looked and Safe Mode is off for PHP, as it is >> shipped >> > with CentOS. I've see forum postings about having Apache run as root, >> but >> > that's not secure. I was wondering if it was possible to put some >> specific >> > commands in sudoers like rsync for apache? That way maybe exec('sudo >> rsync >> > ...'); would work without promoting for a password? >> > >> > I'd greatly appreciate a solution from someone who has already been >> through >> > this. Thanks! >> >> >> Not necessarily a straightforward resolution to this, but some things >> to keep in mind: >> >> - ensure that the CLI and Apache versions of PHP are using the same >> php.ini and that they're logging to the same (or atleast some place >> that you know) >> >> - confirm that the logs don't confirm errors >> >> - use output buffering and system() to execute a command and debug >> what it returns >> >> - permissions are probably a concern which should be reflected in the >> above output >> >> Hopefully that helps a bit :) >> >> H >> > > Thanks for the suggestions. The plot thickens. :-) > > I decided to have system() execute a shell script to do the rsync to see > what happens. In the shell script I have 2>rsync_results to capture what is > going on. system() was returning 255: > > Could not create directory '/var/www/.ssh'. > Host key verification failed. > rsync: connection unexpectedly closed (0 bytes received so far) [receiver] > rsync error: unexplained error (code 255) at io.c(600) [receiver=3.0.6] > > I also added this to the last line of the sudoers file: > apache ALL=(ALL) NOPASSWD: ALL > > Yes, I know that's not secure and it should just be for the rsync command > only, but I tried that first to see if it made any difference at all, but > it doesn't. > > The rsync error output of "Could not create directory '/var/www/.ssh'." to > me at least reveals that the Apache server doesn't have root access and is > operating as user apache, not root. Is my sudoers file wrong? Keep in mind, > if I run this shell script from the command line as root, it works. If I > run the php script from the command line as root it also works. > > There is no .ssh in /var/www/.ssh nor should there be. The .ssh for root > is located in /root. > > It appears this has to do with permissions, but I'm not sure how to do > this properly. Thanks! > > David Roth > > > > > > > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidalanroth at gmail.com Sun Jun 24 19:20:24 2012 From: davidalanroth at gmail.com (David Roth) Date: Sun, 24 Jun 2012 19:20:24 -0400 Subject: [nycphp-talk] Can't do PHP 'exec' for an rsync command via web server In-Reply-To: References: Message-ID: # grep apache /etc/passwd apache:x:48:48:Apache:/var/www:/sbin/nologin You suggesting I change apache to just another user, like this? apache:x:48:48:Apache:/var/www:/bin/bash Maybe generate apache's own set of ssh keys to access the remote server for rsync? Thanks, David Roth On Sun, Jun 24, 2012 at 7:06 PM, Hans Zaunere wrote: > Often the Apache user isn't created with a home directory etc. Check the > passwd file to ensure its a full user with a home and shell? > > Security is another question :) > On Jun 24, 2012 6:52 PM, "David Roth" wrote: > >> >> >> On Sun, Jun 24, 2012 at 11:50 AM, Hans Zaunere wrote: >> >>> > I'm developing a small utility web page to run on my own server which >>> is >>> > running CentOS 6.2 and Apache. PHP 5.3.3. >>> > >>> > I tried using from PHP the exec function and also system, but after >>> checking >>> > the results nothing is returned. However, when I ran a little fragment >>> of >>> > this PHP code from the command line, it worked fine. But it won't >>> execute >>> > and return anything when run from a web page. >>> > >>> > I have searched for an answer and have not been able to find a workable >>> > solution to this. I looked and Safe Mode is off for PHP, as it is >>> shipped >>> > with CentOS. I've see forum postings about having Apache run as root, >>> but >>> > that's not secure. I was wondering if it was possible to put some >>> specific >>> > commands in sudoers like rsync for apache? That way maybe exec('sudo >>> rsync >>> > ...'); would work without promoting for a password? >>> > >>> > I'd greatly appreciate a solution from someone who has already been >>> through >>> > this. Thanks! >>> >>> >>> Not necessarily a straightforward resolution to this, but some things >>> to keep in mind: >>> >>> - ensure that the CLI and Apache versions of PHP are using the same >>> php.ini and that they're logging to the same (or atleast some place >>> that you know) >>> >>> - confirm that the logs don't confirm errors >>> >>> - use output buffering and system() to execute a command and debug >>> what it returns >>> >>> - permissions are probably a concern which should be reflected in the >>> above output >>> >>> Hopefully that helps a bit :) >>> >>> H >>> >> >> Thanks for the suggestions. The plot thickens. :-) >> >> I decided to have system() execute a shell script to do the rsync to see >> what happens. In the shell script I have 2>rsync_results to capture what is >> going on. system() was returning 255: >> >> Could not create directory '/var/www/.ssh'. >> Host key verification failed. >> rsync: connection unexpectedly closed (0 bytes received so far) [receiver] >> rsync error: unexplained error (code 255) at io.c(600) [receiver=3.0.6] >> >> I also added this to the last line of the sudoers file: >> apache ALL=(ALL) NOPASSWD: ALL >> >> Yes, I know that's not secure and it should just be for the rsync command >> only, but I tried that first to see if it made any difference at all, but >> it doesn't. >> >> The rsync error output of "Could not create directory '/var/www/.ssh'." >> to me at least reveals that the Apache server doesn't have root access and >> is operating as user apache, not root. Is my sudoers file wrong? Keep in >> mind, if I run this shell script from the command line as root, it works. >> If I run the php script from the command line as root it also works. >> >> There is no .ssh in /var/www/.ssh nor should there be. The .ssh for root >> is located in /root. >> >> It appears this has to do with permissions, but I'm not sure how to do >> this properly. Thanks! >> >> David Roth >> >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From zaunere at gmail.com Sun Jun 24 20:25:17 2012 From: zaunere at gmail.com (Hans Zaunere) Date: Sun, 24 Jun 2012 20:25:17 -0400 Subject: [nycphp-talk] Can't do PHP 'exec' for an rsync command via web server In-Reply-To: References: Message-ID: <01a001cd5268$ff7beb00$fe73c100$@gmail.com> > # grep apache /etc/passwd > apache:x:48:48:Apache:/var/www:/sbin/nologin > > You suggesting I change apache to just another user, like this? > apache:x:48:48:Apache:/var/www:/bin/bash Yes, though I'd make its own home directory, /home/apache, and give appropriate rights as needed to the doc root. > Maybe generate apache's own set of ssh keys to access the remote server > for rsync? Yeah - just cleanse your input well :) H From davidalanroth at gmail.com Mon Jun 25 00:57:01 2012 From: davidalanroth at gmail.com (David Roth) Date: Mon, 25 Jun 2012 00:57:01 -0400 Subject: [nycphp-talk] Can't do PHP 'exec' for an rsync command via web server In-Reply-To: <01a001cd5268$ff7beb00$fe73c100$@gmail.com> References: <01a001cd5268$ff7beb00$fe73c100$@gmail.com> Message-ID: I'm happy to report this is working now! To recap the adventure for those of you who arrived late...:-) CentOS 6.2. as shipped with PHP 5.3.3. Out of the box I couldn't execute a PHP function (exec or system) to do an rsync with a remote host. The reason was that Apache runs as user apache and doesn't have access to the /root's ssh keys. This was causing an error code of 255 to be returned and no output. A very puzzling and annoying situation as you can well imagine, especially when the thing worked perfectly using PHP on the command line. The fix was to bring apache into the *family*, and make it a regular user on the system and gave it a home. Well, almost a regular user, no password is set so the only way to login to it is through root using 'su'. Logging into apache was needed to generate the ssh keys which were exchanged with the remote host. It was very wise of Hans to also recommend to create /home/apache instead of using the default /var/www because a nasty user could have easily accessed the .ssh directory there and gotten the public/private keys, and the known hosts. Now that apache has its own home, the Tax Assessor will be by Monday to start collecting property taxes. :-) Thanks to everyone who e-mailed me and especially Hans! David Roth On Sun, Jun 24, 2012 at 8:25 PM, Hans Zaunere wrote: > > # grep apache /etc/passwd > > apache:x:48:48:Apache:/var/www:/sbin/nologin > > > > You suggesting I change apache to just another user, like this? > > apache:x:48:48:Apache:/var/www:/bin/bash > > Yes, though I'd make its own home directory, /home/apache, and give > appropriate rights as needed to the doc root. > > > Maybe generate apache's own set of ssh keys to access the remote server > > for rsync? > > Yeah - just cleanse your input well :) > > H > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From danielc at analysisandsolutions.com Mon Jun 25 13:14:16 2012 From: danielc at analysisandsolutions.com (Daniel Convissor) Date: Mon, 25 Jun 2012 13:14:16 -0400 Subject: [nycphp-talk] Can't do PHP 'exec' for an rsync command via web server In-Reply-To: References: <01a001cd5268$ff7beb00$fe73c100$@gmail.com> Message-ID: <20120625171416.GA25378@analysisandsolutions.com> Hi David: > It was very wise of Hans to also recommend to create > /home/apache instead of using the default /var/www because a nasty user > could have easily accessed the .ssh directory there and gotten the > public/private keys, and the known hosts. Well, they still do. Though the attacker would have to be able to add/edit a script on your server, putting in code that reads the files from the /home/apache dir. --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 From greg at freephile.com Mon Jun 25 14:51:39 2012 From: greg at freephile.com (Greg Rundlett (freephile)) Date: Mon, 25 Jun 2012 14:51:39 -0400 Subject: [nycphp-talk] Can't do PHP 'exec' for an rsync command via web server In-Reply-To: <20120625171416.GA25378@analysisandsolutions.com> References: <01a001cd5268$ff7beb00$fe73c100$@gmail.com> <20120625171416.GA25378@analysisandsolutions.com> Message-ID: Although it's a bit confusing, the man page for rsync describes how to invoke SSH to as your remote shell, and the manpage for SSH describes how to do key-based authentication. Taken together, these methods can help when a normal user environment is not present (e.g. in a web script, or from cron). This webpage offers a good explanation of HOWTO http://troy.jdmz.net/rsync/index.html Greg Rundlett On Mon, Jun 25, 2012 at 1:14 PM, Daniel Convissor < danielc at analysisandsolutions.com> wrote: > Hi David: > > > It was very wise of Hans to also recommend to create > > /home/apache instead of using the default /var/www because a nasty user > > could have easily accessed the .ssh directory there and gotten the > > public/private keys, and the known hosts. > > Well, they still do. Though the attacker would have to be able to > add/edit a script on your server, putting in code that reads the > files from the /home/apache dir. > > --Dan > > -- > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > data intensive web and database programming > http://www.AnalysisAndSolutions.com/ > 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 > _______________________________________________ > New York PHP User Group Community Talk Mailing List > http://lists.nyphp.org/mailman/listinfo/talk > > http://www.nyphp.org/show-participation > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidalanroth at gmail.com Tue Jun 26 02:19:01 2012 From: davidalanroth at gmail.com (David Roth) Date: Tue, 26 Jun 2012 02:19:01 -0400 Subject: [nycphp-talk] Can't do PHP 'exec' for an rsync command via web server In-Reply-To: References: <01a001cd5268$ff7beb00$fe73c100$@gmail.com> <20120625171416.GA25378@analysisandsolutions.com> Message-ID: That a good tutorial. I've been using rsync with ssh successfully for a numbers of years in shell scripts and cron jobs, but not through exec or system in PHP until now. Which is why it was so frustrating that it wasn't working with PHP, when I never had problems with rsync/ssh before. Greg also brings up a good point about security. For me, this is an in-house server behind a firewall and while I expected to put it in the DMZ, I've found that's a bad idea, because one afternoon after placing it in the DMZ I saw in the logs a few of bots trying to break in and do nasty stuff. So if someone needs access to anything, I put it on an external hosting service where they are better equipped to handle bot attacks. I came to this conclusion after a Linux Admin told me he spends time each day checking for attempted break-ins and blacklisting bots. Am I asking for trouble by creating ssh keys for apache user under these circumstances, I certainly hope not, but I've not found an acceptable work-around. It was mentioned to me that I could also do something with iptables, but I've not had the time to check it out. David Roth On Mon, Jun 25, 2012 at 2:51 PM, Greg Rundlett (freephile) < greg at freephile.com> wrote: > Although it's a bit confusing, the man page for rsync describes how to > invoke SSH to as your remote shell, and the manpage for SSH describes how > to do key-based authentication. Taken together, these methods can help > when a normal user environment is not present (e.g. in a web script, or > from cron). This webpage offers a good explanation of HOWTO > http://troy.jdmz.net/rsync/index.html > > Greg Rundlett > > > > On Mon, Jun 25, 2012 at 1:14 PM, Daniel Convissor < > danielc at analysisandsolutions.com> wrote: > >> Hi David: >> >> > It was very wise of Hans to also recommend to create >> > /home/apache instead of using the default /var/www because a nasty user >> > could have easily accessed the .ssh directory there and gotten the >> > public/private keys, and the known hosts. >> >> Well, they still do. Though the attacker would have to be able to >> add/edit a script on your server, putting in code that reads the >> files from the /home/apache dir. >> >> --Dan >> >> -- >> T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y >> data intensive web and database programming >> http://www.AnalysisAndSolutions.com/ >> 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 >> _______________________________________________ >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From leamhall at gmail.com Wed Jun 27 04:45:04 2012 From: leamhall at gmail.com (Leam Hall) Date: Wed, 27 Jun 2012 04:45:04 -0400 Subject: [nycphp-talk] Using greater than zero or multiplication? Message-ID: <4FEAC810.2000700@gmail.com> Morning all! I'm working on my Tech Dive Planner and wanted to get a best practice idea from you. There are some calculations that need 3-5 variables set or the calculation isn't done. Since all the inputs are numeric and set to a default of zero, is it better to test each input to see if it's greater than zero or just multiply them once and see if the result is greater than zero? In the grand scheme of things there's no serious performance hit either way, the app is pretty small. I am trying to build my skills and good habits though. Thanks! Leam From rick at click-rick.net Wed Jun 27 06:40:08 2012 From: rick at click-rick.net (Rick Retzko) Date: Wed, 27 Jun 2012 06:40:08 -0400 Subject: [nycphp-talk] Using greater than zero or multiplication? In-Reply-To: <4FEAC810.2000700@gmail.com> References: <4FEAC810.2000700@gmail.com> Message-ID: <6D6C2F864951413B9DDF2E14A3460A45@home> IMHO: Testing the sum tells you nothing about the components but should be included following the test of each component. -----Original Message----- From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Leam Hall Sent: Wednesday, June 27, 2012 4:45 AM To: NYPHP Talk Subject: [nycphp-talk] Using greater than zero or multiplication? Morning all! I'm working on my Tech Dive Planner and wanted to get a best practice idea from you. There are some calculations that need 3-5 variables set or the calculation isn't done. Since all the inputs are numeric and set to a default of zero, is it better to test each input to see if it's greater than zero or just multiply them once and see if the result is greater than zero? In the grand scheme of things there's no serious performance hit either way, the app is pretty small. I am trying to build my skills and good habits though. Thanks! Leam _______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show-participation From ramons at gmx.net Wed Jun 27 07:06:45 2012 From: ramons at gmx.net (David Krings) Date: Wed, 27 Jun 2012 07:06:45 -0400 Subject: [nycphp-talk] Using greater than zero or multiplication? In-Reply-To: <4FEAC810.2000700@gmail.com> References: <4FEAC810.2000700@gmail.com> Message-ID: <4FEAE945.8030907@gmx.net> On 6/27/2012 4:45 AM, Leam Hall wrote: > Morning all! > > I'm working on my Tech Dive Planner and wanted to get a best practice idea > from you. There are some calculations that need 3-5 variables set or the > calculation isn't done. Since all the inputs are numeric and set to a default > of zero, is it better to test each input to see if it's greater than zero or > just multiply them once and see if the result is greater than zero? > > In the grand scheme of things there's no serious performance hit either way, > the app is pretty small. I am trying to build my skills and good habits though. > > Thanks! > > Leam Not that I am an expert in best practices, but I'd test each to be larger than zero. If you multiply them all you will only know that one of them is zero, but you do not know which one. How do you then report that to the user for corrections? OK, with five variables it should be somewhat easy for the user to figure out which one is 0 or missing, but what happens when your user is visually impaired? It will be a much bigger burden for them as they need to traverse each field. In short, test each of them and then craft a summary response that indicates wich entry / entries are zero and need correction. David