News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
Using SSH and SFTP with PHP
January 10, 2013 @ 11:31:52

On PHPMaster.com today there's a quick tutorial showing you how to use SSH and SFTP from inside your PHP applications (requiring the ssh2 package).

In today's world with so many third-party integrations and content-sharing, it's important to understand and make use of protocols like SCP and SFTP. PHP's SSH2 extension, a wrapper for libssh2 which implements the SSH2 protocol, provides several functions you can use to securely transfer files.

Sample code is included showing how to make a SSH request to a remote server, define the key files to use and execute a remote command (like scp). They also mention the use of wrapper functions like mkdir that also work with SSH/SFTP connections. The post finishes up with an example class or two you can use to wrap your connection handling and make it a bit more OOP-friendly.

0 comments voice your opinion now!
ssh sftp extension pecl tutorial oop


Lorna Mitchell's Blog:
Using an Existing Vagrant Setup for PHP Development
May 09, 2012 @ 10:50:24

In this new post to her blog Lorna Mitchell dives into the world of vagrant/puppet/chef and looks at using the tools to automatically create VMs that you can use for PHP development (or testing).

I've been hearing great things about puppet, chef, vagrant, and friends for a while now, but since I work on my own I tend to either develop straight onto my ubuntu machine or grab an appropriate existing VM and use that. So I read about this brave new world of virtualisation but (as with most tools) they can be hard to introduce on your own, and I didn't. [...] Then I went to WhiskyWeb, which had a hackathon [...] with the shiny new technology all packaged for me, I decided it was time to take a look!

She shows you how to get the VM started up using vagrant, pausing the instance and removing it all together (destroy). She also includes the command to directly access the VM via ssh and links to the joind.in project with its sample puppet configuration and Vagrant file.

0 comments voice your opinion now!
vagrant introduction setup development ssh suspend puppet chef


Mark Hamlin's Blog:
Debugging xdebug (tcp, dns, ubuntu, osx, vmware) ((all at once))
August 31, 2011 @ 13:04:43

In a recent post to his blog Mark Hamlin talks about some of his difficulties in getting XDebug and Netbeans working together from an OSX machine hitting a Ubuntu server.

For the past 18 months working with PHP, i've primarily used alternatives, not out of preference, but because netbeans xdebug integration consistently failed me. It would (might) work with a remote apache, but would not play with scripts executed remotely from the command line. I could be fairly sure my xdebug config was sound as I no problems with MacGDB and PHPStorm whatsoever.

With a little more investigation, he discovered that it was the OSX firewall causing issues. He found that, with a new incoming connection came a confirmation box to approve the connection. This, of course, wasn't passed along to Netbeans so he never saw it. In the end, he set up a reverse SSH tunnel to bypass the firewall completely (command included).

0 comments voice your opinion now!
debug netbeans firewall xdebug ssh tunnel ubuntu osx


Derick Rethans' Blog:
Remote Debugging PHP with a Firewall in the Way
August 26, 2011 @ 11:24:17

Sometime debugging PHP applications isn't as easy as just pointing your IDE directly at the server and starting to work. Derick Rethans has a new post talking about one such situation, remote debugging with a firewall in between you and the remote machine with XDebug.

The PHP debugging extension Xdebug has "remote" debugging capabilities for single-step debugging PHP applications. This works by setting your favourite IDE into listening mode and instructing Xdebug (with one of the handy browser extensions for example) to initiate debugging. [...] There could however be a firewall in the way that prevents Xdebug connecting directly to your IDE's IP address. That can be because the network you are on employs NAT. [...] In this case, there is no way Xdebug can connect to your IDE's IP address and port. Or is there?

His alternative requires SSH access to the remote machine - building a tunnel from your local machine to the remote server XDebug can use to get around the firewall. He explains the shell command to set up the tunnel and, a more graphical way, through the Putty ssh/telnet client. A quick call to "netstat" can tell you if things are working correctly or not. All that's left then is to point your XDebug to the port on the localhost and you should be good to go on debugging.

0 comments voice your opinion now!
debugging firewall tutorial ssh tunnel xdebug ide


NetTuts.com:
Managing Cron Jobs with PHP
April 08, 2011 @ 12:39:30

New on NetTuts.com there's a tutorial about using cron with PHP and how to manage the jobs your server currently runs.

The cronTab, or "Cron Table", is a Linux system process / daemon which facilitates the scheduling of repetitive tasks thereby easing up our day to day routine. In this tutorial, we'll create a dynamic PHP class that, using a secure connection, provides us with a means to manipulate the cronTab!

They explain the cron format (time and script to run) and how to set up a crontab management class that uses the ssh extension for PHP to communicate with the remote server. Their class includes methods for setting up jobs, writing them out to the cron file, removing existing jobs and dropping the entire cron file at once.

0 comments voice your opinion now!
cronjob manage ssh tutorial


Mark Karpeles' Blog:
PHP can do anything, what about some ssh?
June 28, 2010 @ 13:38:18

In an effort to just about everything he can with PHP Mark Karpeles has posted an article about how he created a SSH server in PHP with most (not quite all) of the functionality of some of its counterparts.

You probably know SSH at least by its name. It's a of secure telnet replacement which also allows many other things such as port forwarding, remote file management (with sftp) and more. With PHP I could write a fully working SSH server in only 3 days. [...] My goal when writing this was to provide a replacement for the FTP protocol for the customers of my hosting service.

He lists the extensions used to create the extension - OpenSSL, mcrypt, hash and (the most important) GMP as well as a link to the source if you'd like to try it out yourself.

24 comments voice your opinion now!
openssl mcrypt has gmp ssh server


Till's Blog:
PEAR & Plesk
December 10, 2008 @ 09:34:15

In this new post to till's blog, he looks at a method for setting up PEAR on a Plesk system.

Now running any config interface is a blog entry by itself and when I say Plesk, I should also mention confixx and cpanel. And while I have a strong dislike for all them, let me focus on Plesk for now. This is not a copy'n'paste howto, so make sure you double-check all steps involved. With little knowledge, you should be able to to apply all instructions to any other control panel, all you need is SSH access to the server.

The process includes two different sections - why your PEAR installation may not be working and how to install the PEAR packages (on any system supporting a package manager). Command line calls and configuration options are also included.

0 comments voice your opinion now!
pear plesk install troubleshoot package controlpanel ssh


David Van Couvering's Blog:
Real-world experience with the new NetBeans PHP and JavaScript editors
August 14, 2008 @ 09:32:56

David Van Couvering has posted about some of his experience with the latest version of the NetBeans editor for some of his PHP and Javascript development work.

Yesterday I spent the whole day trying to help a friend in need who had waded in too deep with a contract he has. He has no database experience, and was trying to customize a Wordpress plugin that uses PHP, JavaScript and MySQL. So I downloaded the daily build of the PHP bundle of NetBeans for 6.5 and started working.

He happily notes that things like syntax highlighting, inline documentation and completion were still there in the PHP bundle as well. He also mentions a few other things that could come in handy for the IDE - ssh tunnel support (see here), an "Add Column Wizard" and a "Insert DLL Wizard".

0 comments voice your opinion now!
netbeans ide javascript bundle experience ssh tunnel wizard dll sql


Developer Tutorials Blog:
Port Scanning and Service Status Checking in PHP
June 10, 2008 @ 08:46:08

The Developer Tutorials blog has posted a new tutorial covering how to scan ports and checking a remote service's status with PHP.

Having access to the current status of public servers can empower your applications to make decisions and respond to problems automatically. Acknowledging a service is offline can also save endless support emails. In this tutorial, I'll show you how to keep track of your server status by scanning ports on your server with PHP.

They show how to check a remote instance (a socket open with a timeout) and how to run through a list of ports, looping from one to one-thousand and running an fsockopen on each. They make a sample script to show these two combined - a simple page that loops through the common protocols (HTTP, FTP, SSH, etc) and checks to see if the remote machine is running something on that port.

0 comments voice your opinion now!
port scan service status check fsockopen http ftp ssh


Pear-Code-Authors.com:
Installation of a local PEAR copy on a shared host
March 27, 2008 @ 12:02:43

Jacques Marneweck points out a tutorial he came across showing how to perform an installation of the PEAR library system on a shared host.

This is quite useful when you are forced into using a clueless shared host who only have the bare PEAR installation on their servers, and have not ever considered installing DB, Mail, Net_SMTP, etc. which lots of people use instead of reinventing the wheel with each project.

The steps of the tutorial are pretty simple and they include two different ways - installing it to your docroot directory if the web host already has the pear binary set up or using ftp/ftps/sftp to upload and install the needed files.

1 comment voice your opinion now!
installation pear shared host binary ssh ftp method tutorial



Community Events





Don't see your event here?
Let us know!


language list interview community wordpress api developer laravel bugfix series symfony library application install introduction code configure release threedevsandamaybe podcast

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework