Log in
R. Kris Hardy Photo

R. Kris Hardy

January 5, 2010

Terry Chay – 1500 Lines of Code

Filed under: Development — Tags: , , , , , — Kris @ 9:34 pm

Here is an outstanding article on web development philosophy that really got me thinking today, written by Terry Chay of Wordpress.  It’s long, but well worth the read.

1500 Lines of Code

This really got me thinking, and I’ll probably work on a comment to it this week.

Technorati Tags: , , , , ,

December 10, 2009

Permission Denied (13) When Opening Socket in PHP & Apache

I ran into this simple, but annoying, problem after I migrated my development workstation to Fedora 12.

Problem:

A large PHP application that I have developed at Submerged Solutions (SandPiper Accounting) began throwing Permission Denied (13) system exceptions when attempting to send mail through Zend Framework’s Zend_Mail library.

All the phpunit unit tests worked fine and could send e-mail, but would fail when the usability tests started and any HTTP requests that sent e-mail were handled through Apache.

The Apache instance was being run as user apache / group apache, and php (mod_php) is run as user apache / group apache.

The exception occurred in Zend_Mail_Protocol_Abstract->_connect(), immediately following the socket opening call “stream_socket_client(…)”.

File: Zend/Mail/Protocol/Abstract.php; Line 224

50: abstract class Zend_Mail_Protocol_Abstract
51: {
...
218: protected function _connect($remote)
219: {
220: $errorNum = 0;
221: $errorStr = '';
222:
223: // open connection
224: $this->_socket = @stream_socket_client($remote, $errorNum, $errorStr, self::TIMEOUT_CONNECTION);
225: ...

fopen() calls using http and ftp protocols also failed:

Warning: fopen(…) [function.fopen]: failed to open stream: Permission denied in …

    The fix:

    The problem turned out to be the “httpd_can_network_connect” SELinux setting that is on by default in Fedora 12.

    In a shell console, run as root:

    # /usr/sbin/setsebool httpd_can_network_connect=1

    Thanks to durwood, who pointed this out on PHP.net.

    “Bug” Report at RedHat.com.

    More info on SELinux.

    Technorati Tags: , , , , , , ,

    June 19, 2009

    MIT/Stanford/Syracuse Team Develop New PHP Intepreter-Based XSS and SQL Security Tester

    Filed under: Development — Tags: , , , , — Kris @ 5:55 am

    Ardilla PaperA group of researchers from MIT, Stanford and Syracuse have developed a new program, named “Ardilla”, which can analyze PHP code for Cross-Site Scripting (XSS) and SQL injection attack vulnerabilities.

    Rather than just static analysis, this program actually traces the data through the software to determine whether the threat is real. This decreases false-positives significantly, compared to simple static analysis.

    Here’s the technical paper for all us serious geeks…

    (more… >>)

    Technorati Tags: , , , ,


    Powered by WordPress