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

Joshua Thijssen's Blog:
Setting up a development environment
Feb 06, 2012 @ 15:27:41

In a new post to his blog Joshua Thijssen gives a guide to how he usually sets up his development environments when working in PHP. It includes working with virtual machines, configuring DNS and setting up his tools to work with it all.

Doing development on multiple projects can be a burden from time to time. One project would be running on PHP 5.3, while another still needs 5.1. Sometimes you need a MySQL server, while on other occasions, you need a NoSQL solution like couchDB or MongoDB together with all kind of gearman functionality. This article shows you how I’ve setup such a development platform that allows you to quickly create new projects, and still maintain flexibility when you need it.

He uses VirtualBox with either a Debian or CentOS installation as a base platform. He uses Vagrant to set up and configure the machines to make setup almost automatic. He still has to go in and configure a few things like the VirtualHost and DNS settings for the site/application he's working on. Next up is setting up the tools he uses, specifically XDebug and setting up his editor of choice (PHPStorm) for remote debugging.

tagged: development environment virtualbox debian centos mysql vagrant xdebug phpstorm dns virtualhost

Link:

PHPBuilder.com:
PHP Scripts for Interacting with Networks
Dec 15, 2010 @ 19:49:31

On PHPBuilder.com there's a new tutorial showing you some of the PHP functions that you can use to interact with the network surrounding (and even vaguely related to) your application.

PHP has a great many tools for interacting with a network and also with the Internet. In this article, I examine some of those tools and functions to show how exactly you can use them to make your scripts more useful in a network environment. Click here to download the accompanying source code.

They show how to use fopen to access remote sites, gethostbyname and gethostbyaddr for DNS resolution, getprotobynumber to check the port number for a TCP/IP type and quite a few more. This also includes a brief look at the PEAR Net_Whois package. You can download the examples if you'd like to just jump into the code.

tagged: network interaction tutorial tcpip socket dns

Link:

NetTuts.com:
Basecamp Style Subdomains With CodeIgniter
Nov 18, 2010 @ 18:38:23

On NetTuts.com today there's a new tutorial showing you how to use the CodeIgniter framework to create Basecamp-style subdomains in your application.

CodeIgniter is a simple and lightweight PHP framework used to create powerful web applications. Today, we are going to do something nifty: we’ll combine user names and subdomains to make for a more cohesive user experience. If you’re a bit confused, this feature allows your users to access their accounts by typing in a custom url, which maps to their user name, such as harbinger.yourapp.com.

Their setup shows the homepage for the application if you go directly to the domain but changes to a login form when you hit the subdomain. There's a bit of DNS configuration involved to get the subdomains working (you'll have to add in a wildcard to catch the subdomains). They show you how to set this up on your localhost if you're working on OSX or Windows. With a few changes to the Apache server for virtual host and a basic install of CodeIgniter, they get started creating the database tables and control panel application.

tagged: basecamp subdomain codeigniter tutorial framework dns apache

Link:

Kevin Schroeder's Blog:
You want to do WHAT with PHP? Chapter 2
Aug 27, 2010 @ 13:09:07

Kevin Schroeder has posted a new book excerpt from his "You Want to Do WHAT with PHP?" book - chapter two dealing with binary protocols.

PHP developers know text really, really well. We can write SQL, we can build HTML, we can work with XML. But computers don't speak in terms of structured text markup, they speak in terms of bytes. And while there are many PHP developers who can speak at the lower level of bytes and bits and such, there are many more that have difficulty there.

His short excerpt (from a very long chapter) talks about working with DNS information and how you can send requests (similar to the unix "host" command) and parse them correctly. Some sample code is provided to make a request for a record on mcpressonline.com and the output it would produce.

tagged: book excerpt kevinschreoder binary dns request

Link:

Vanessa Vasile's Blog:
Using PHP to Perform DNS Lookups
Jul 01, 2010 @ 16:37:51

In a handy little post to her blog today Vanessa Vasile has an example of how to use built-in PHP functions to perform DNS lookups in your scripts.

PHP has a couple DNS functions you can use to perform record lookups. Most of us are familiar with the two basic ones - gethostbyname() and gethostbyaddr(), both of which perform a single function – returning a hostname or IP address.

She also mentions the gethostbynamel and dns_get_record functions that can give you even more insight into the current DNS of a given domain (even returning only record-type specific information).

tagged: dns lookup tutorial hostname

Link:

Mark Karpeles' Blog:
PHP DNS Daemon
Feb 17, 2009 @ 18:06:24

Mark Karpeles has created something that most people would think he's crazy for - a DNS daemon written in PHP:

If you want to tell me I'm crazy, you can post it in a comment here, it makes me happy. I had some reasons to dislike bind9 which finally made me write my own DNS daemon, and I'll explain that here. My need was to have a stable dynamic DNS server working in most environments, with an easy to configure master/slave relationship (with realtime synchronization), and a way to change records instantly from PHP...

Rather than using the (slightly unstable) dlz technology to pull the information from a MySQL database, he opted to roll his own that includes support for:

  • RFC 1035 standards
  • realtime data update
  • slave/master relationship (with a keepalive connection)

Want to try it out for yourself? Drop him a line and ask about it!

He's also run some statistics on the performance of the daemon as compared to the standard BIND installation and come up with some instructions on how you can install and configure your own instance.

tagged: dns daemon mysql custom rfc1035 master slave synchronize

Link:

DevShed:
PHP Networking
Sep 09, 2008 @ 17: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).

tagged: tutorial network socket dns netwhois pear

Link:

HowTo Forge:
Fedora 8 Server Setup - LAMP, Email, DNS, FTP, ISPConfig - Page 6
Nov 12, 2007 @ 15:32:00

On the HowTo Forge website, there's a new tutorial that walks through the complete steps of setting up a Fedora 8 linux server with a full LAMP stack complete with email, DNS, FTP and ISPConfig support. They call it the "Perfect Server".

This is a detailed description about how to set up a Fedora 8 server that offers all services needed by ISPs and hosters: Apache web server (SSL-capable), Postfix mail server with SMTP-AUTH and TLS, BIND DNS server, Proftpd FTP server, MySQL server, Dovecot POP3/IMAP, Quota, Firewall, etc. This tutorial is written for the 32-bit version of Fedora 8, but should apply to the 64-bit version with very little modifications as well.

It's a seven page process with plenty of screenshots and settings to help make the installation nice and easy.

tagged: howto tutorial lamp fedora linux setup email dns ftp ispconfig howto tutorial lamp fedora linux setup email dns ftp ispconfig

Link:

HowTo Forge:
Fedora 8 Server Setup - LAMP, Email, DNS, FTP, ISPConfig - Page 6
Nov 12, 2007 @ 15:32:00

On the HowTo Forge website, there's a new tutorial that walks through the complete steps of setting up a Fedora 8 linux server with a full LAMP stack complete with email, DNS, FTP and ISPConfig support. They call it the "Perfect Server".

This is a detailed description about how to set up a Fedora 8 server that offers all services needed by ISPs and hosters: Apache web server (SSL-capable), Postfix mail server with SMTP-AUTH and TLS, BIND DNS server, Proftpd FTP server, MySQL server, Dovecot POP3/IMAP, Quota, Firewall, etc. This tutorial is written for the 32-bit version of Fedora 8, but should apply to the 64-bit version with very little modifications as well.

It's a seven page process with plenty of screenshots and settings to help make the installation nice and easy.

tagged: howto tutorial lamp fedora linux setup email dns ftp ispconfig howto tutorial lamp fedora linux setup email dns ftp ispconfig

Link:

Arnold Daniels' Blog:
Wrong PHP prediction: you don’t need to patch PHP to run multiple versions
Sep 10, 2007 @ 21:55:00

In a new post today, Arnold Daniels has posted about (and linked to) a few methods for running PHP4 and PHP5 on the same server at the same time - running them as CGIs.

You simply can't have PHP4 and PHP5 both run as Apache2 module in the same process, because they use a lot of the same internal symbols (variables, function names, etc). If you would change that, nobody would be able to write any extensions which run both on PHP4 and PHP5. However you can run multiple PHP versions as CGI modules and there is no patch required for that.

He points out an article from Giunta Gaetanos that handles it similarly, but requires the filename to match a certain pattern to determine which to use. He suggests a slightly different alternative, namely using different IPs for PHP4 vs PHP5 and use DNS to route the domains to the right locations.

tagged: php4 php5 patch multiple version ip dns php4 php5 patch multiple version ip dns

Link:


Trending Topics: