News Feed
Jobs Feed
Sections




Recent Jobs

News Archive
feed this:

CatsWhoCode.com:
How to easily monitor your web server using PHP
February 08, 2010 @ 13:48:31

In a new post to the CatsWhoCode.com blog Jean-Babtiste Jung walks you through the creation of a simple monitoring script written using just PHP that can tell you if your web site is up and responsive.

In order to make sure that your website is always available to the public, you have to monitor it. In this tutorial, I'll show you how you can easily create a monitoring script that will check your website availability and send an email or sms alert to you if it isn't.

They have a snippet of code (about 15 lines long) with a function you can call to check a remote host's connection and check the returned data for a certain string. This can not only ensure that your site is responsive but also that it's not responding incorrectly. You could even use this to hit a certain monitoring page of your site to check for certain things (like database connection problems).

0 comments voice your opinion now!
monitor webserver tutorial socket



Christian Weiske's Blog:
PHP Testfest Berlin 2009
May 12, 2009 @ 12:05:46

Christian Weiske has posted about his experience at this year's TestFest in Belin (as hosted by the Berlin PHP User Group).

I spent the last weekend (may 09/10) on the PHP Testfest Berlin, organized by Till for the Berlin PHP Usergroup. Coming from Leipzig, I don't really know who of the other 8 people were from the user group and who not.

He mentions issues the group faced (OS X being difficult, PHP from CVS not compiling), the intro to testing and their first area of choice - gettext (which they got up to 98.8% coverage!). The second and third efforts were some work done on the intl and sockets extensions.

0 comments voice your opinion now!
testfest berlin testfest09 extension test gettext intl socket


DeveloperTutorials.com:
Port Scanning and Service Status Checking in PHP
April 08, 2009 @ 08:49:21

On the DeveloperTutorials.com site today there's a new tutorial showing the creation of a port scanner with PHP - a tool that, given some of the familiar ports that services (like web or email servers) run on, can check to see if they're responding.

While building web applications, it's often important to keep an eye on the other services running on your server. 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.

Their example makes a socket connection to the remote port to see if there's a valid hookup. The wrap this inside a loop for ports 1 through 1000 to see what ports are open and responding on your local machine (doing this on a remote machine is just asking for trouble).

Their full example defines some of the common ports in an array and loops to check on their status. It sets out a base you can build on top of with things like their suggestions - logging scan results, repoting downtime and running a service-specific task.

0 comments voice your opinion now!
port scan fsockopen socket http ftp pop3 check connection


DevShed:
PHP Networking
September 09, 2008 @ 12:09:12

In a new tutorial from DevShed today, they take a look at some of the "networking" functions that PHP has to offer - basically anything that can make a network connection.

PHP has a great many tools for interacting with a network and also with the Internet. In this article we will look at some of those tools and functions to see how we can use them to make our scripts more useful in a network environment.

They look at the fopen, gethostbyname, gethostbynamel, getservbyport and the Net_Whois PEAR package (among others).

0 comments voice your opinion now!
tutorial network socket dns netwhois pear


ThinkPHP Blog:
Comet in conjunction with a PHP socket server - server-client communication
September 02, 2008 @ 08:41:55

In a new post to the ThinkPHP blog today there's a look at combining Comet with PHP to make a simple method for the client to talk back to the server outside the usual methods.

If a couple of users have opened the application there are already some hundred or thousand requests per second. The outcome of this is a big load for your server and a highly increased traffic - your server will in a senseless way be overloaded. In conclusion, our problem is the enormous amount of polling without knowing whether the server really wants to send a new push. Let's turn the initial situation around. And we get the solution to our problem: Comet.

With Coment, the model changes and the request is "cached" on the server-side automatically in a single Comet instance. Coordinate this with another recommendation of theirs, a PHP socket server, and you can do some pretty interesting things.

0 comments voice your opinion now!
communication socket server comet ajax push pull


AnyExamples.com:
PHP Whois Client Function
September 19, 2007 @ 08:43:00

On the AnyExamples.com website, there's a new little how to on making a whois client in PHP (without just using an exec or similar call to the filesystem).

This article contains PHP implementation of whois client (as a function ae_whois), which may be used to request domain information from specified whois servers.

Their method uses the socket functionality (fsockopen, fwrite, fclose) to make a connection to the remote server for the specified domain's information.

0 comments voice your opinion now!
whois client function socket fsockopen fwrite fclose whois client function socket fsockopen fwrite fclose



Chris Chabot's Blog:
phpSocketDaemon
December 18, 2006 @ 18:08:00

Chris Chabot has posted a PHP package he's worked up that functions as a daemon sitting and listening on a socket.

To deal with 1000's of concurrent, always on (comet aka hanging iframe) http (server) connections, and an equal amount of IRC client connections, plus being able to interpret and parse and delegate all the messages and events, i needed a very fast, stable, flexible and easy to use 'daemon' library for PHP.

He links to the tarball of the release and to the project page as well as including an example of its usage - creating a simple HTTP server with various hooks built in (like on_connect, on_read, and on_timer).

0 comments voice your opinion now!
socket daemon phpsocketdaemon download example socket daemon phpsocketdaemon download example


PHP Security Blog:
Cross Virtual Host Cookie Theft
December 15, 2006 @ 08:09:00

In this new post on the PHP Security Blog, Stefan Esser brings up an interesting issue when dealing with web applications - being able to bind a script/application to a different port on the local machine.

Unfortunately the ability to bind yourself to a port and receive connections is a threat to webapplications installed on different virtual hosts on the same IP, even if other security measures in place, like tight filesystem permissions or executing PHP script with the permission of the owner.

He gives an example in PHP of how this can happen and one of the scary side effects of having it in the same domain - the cookie information is passed in. It's a simple concept that could have very bad consequences in the wrong hands.

Additionally, you don't even have to create it in PHP either. As cyberlot mentions, it could be created in any language that has socket functions. Be sure to check out the comments for more thoughts and comments on the post.

2 comments voice your opinion now!
virtual host cookie theft socket example function virtual host cookie theft socket example function


Shahar Evron's Blog:
Adapters of the new Zend_Http_Client
December 07, 2006 @ 14:41:00

On his blog, Premature Optimization, Shahar Evron has posted some information about work he's done on the Zend_Http_Client package of the Zend Framework - including the push to make it live.

Earlier this week, I finally (after long and hard work) pushed the Zend_Http_Client out of the incubator and into the core of Zend Framework, and it will be released with the 0.6 preview release.

Some of the things introduced in this package include the introduction of "connection adapters", a method of having an adapter object made responsible for handling the networking connection. The default for this is the socket adapter, but work is already being done to create cURL and future ideas for a caching adapter or a pfsockopen-based option for more preferment connection needs.

Shahar also includes some stats to show off what the new package can do and how many requests per second it can handle.

0 comments voice your opinion now!
zendhttpclient zend framework package adapter socket curl cache zendhttpclient zend framework package adapter socket curl cache



Community Events









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


job podcast hiphop feature windows conference zendframework microsoft performance release facebook wordpress opinion drupal apache developer extension framework codeigniter symfony

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