Here is the slide deck for my talk on BasicIntrusionDetectionWithPHPIDS. If you were one of the 19 attendees, please give feedback at Joind.in
Tag: php
OSX PHP 5.5 Beta 1 Build part 2 (Bison)
In my previous post I was trying to get PHP 5.5 beta 1 compiled on my OSX laptop. It turns out that Mountain Lion ships with a version of Bison from 2006. Really Apple? There is a difference between being a hipster and being old. Let’s fix this! If you have not read it already and installed autoconf and git, make sure to do so.
Upgrading Bison:
- Go to http://ftp.gnu.org/gnu/bison/ and get 2.6.2. Why not 2.7.1? Because PHP doesn’t support it yet. You would need to manually patch Zend/acinclude.m4 to allow for it.
- tar -zxvf bison-2.7.1.tar.gz
- cd bison-2.7.1
- ./configure –prefix=/usr/local
- make
- sudo make install
- export PATH=/usr/local/bin:$PATH
Now we have a new version of bison in /usr/local/bin. Time to configure php again.
./configure --with-apxs2=/usr/sbin/apxs --enable-cli --with-config-file-path=/etc --with-libxml-dir=/usr --with-openssl=/usr --with-kerberos=/usr --with-zlib=/usr --enable-bcmath --with-bz2=/usr --enable-calendar --disable-cgi --with-curl=/usr --enable-mbstring --enable-mbregex --with-mysql=mysqlnd --with-pdo-mysql=mysqlnd --with-mysql-sock=/var/mysql/mysql.sock --with-libedit --with-readline=/usr --enable-shmop --with-snmp=/usr --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-tidy --with-iconv-dir=/usr --enable-zip
And it worked! Will it blend?
make ... Build complete. Don't forget to run 'make test'. $
Yes in deed. I made sure to run “make test” as well and not everything passed so I sent in the report. Make sure you do as well.
OSX 10.8.3 PHP 5.5 pre Build
At the urging of @akrabat at #tek13, I decided to see if I could compile #php 5.5 on my cleanly installed Mountain Lion. Here is how it went.
I was running into some date validation problems between jQuery datepicker and ZF1. My client wanted one date picker to use a “January 01, 2000” format, and the others a “01/02/2000” format. Seems simple enough.
AngularJs Zend Framework 1 Resource Plugin
I whipped up a simple ZF1 resource plugin for AngularJs called AngularZF1 and dropped it onto github. We have started using Angular at work and I thought, why not mimic how the ZendX_JQuery plugin works. Right now it doesn’t add much beyond just adding the script tag to your <head>. Enjoy, all you who are still on ZF1!
Oracle in PHP Frameworks
I have been using Zend Framework 1.x at work for some time now. I appreciate the large number of components, many of which my system uses on a daily basis. Yes, it is a large library, but we have a very large application that probably does too many things.
ZF2 is coming out soon and it seems quite different from 1.x. I downloaded the betas and skeleton app, and looked at the well written tutorials, but I am still having a difficult time wrapping my mind around it. So I have decided to see if the grass is greener elsewhere. There are plenty of PHP frameworks out there to choose from, but I have one particular requirement: Oracle support. I work in a somewhat regulated space and the big vendors are preferred over the Open Source databases. And not just any Oracle support, we need to use the oci8 driver.
Most of the new frameworks prefer to use PDO for their database abstraction layer. This is fine for most people who are using MySQL or PostgreSQL. This is not great for us Oracle users. Although there is a pdo_oci extension, it is very buggy. We have to use the oci8 driver instead. And no, I cannot just switch to MySQL.
So, which of the frameworks support oci8? *feel free to correct me in your comments
Framework | DBAL | oci8 | Notes |
---|---|---|---|
ZF 1.x | Internal | Y | |
CodeIgniter 2 | – | Y | |
Symfony2 | Doctrine | Y | According to the Doctrine 2.0x docs oci8 is supported. |
ZF2 | Internal/Doctrine | Y | |
CakePHP 2.x | – | + | http://www.hassanbakar.com/2012/01/09/using-oracle-in-cakephp-2-0/ |
Lithium | Internal | N | MySQL, SQLite3, CouchDB, MongoDB |
Aura | Wrappers around PDO | N | MySQL, PostgreSQL, SQLite3, SQLServer |
DooPHP | Wrappers around PDO | N | |
Yii | Internal | ? | Found a note from 2009 saying it worked |
FuelPHP | Internal | ? | |
Slim | – | No DB support in framework |
When I was researching frameworks 3 years ago I looked at Doctrine as a DBAL and even contributed a few patches to the project, but eventually got frustrated enough to bail on it and go with ZF’s vanilla approach. Should I try out Doctrine again or use something like Slim and keeping all my existing ZF1 database code?
About once every other week I try and spend some time at work thinking ahead. With PHP 5.4 on the horizon I began to wonder how our current Zend Framework application would fare if the SysAdmins decided to jump straight from PHP 5.2 to PHP 5.4. Would the site work at all? One way to find out. Lets install PHP 5.4RC8 and Apache 2.4.
I started by creating a fresh Ubuntu 11.10 VM. In complete disclosure, I removed some of the unneeded packages like LibreOffice first. I then cloned it so I would always have a base to work off of in the future.
ZF Config XML vs Ini Showdown
Back at php|tek11 Rob Allen gave a talk on optimizing Zend Framework. During the tutorial he pointed out how you could cache your application config files so that they are not loaded and parsed at every request. This got me thinking about something that had been bugging me for a long time. What is the best format for your config file?
Back before ZF 1.0 there was a fair bit of confusion on how to do everything “right”, especially setting up a “modular” build. One of the first good examples out there was made by Dasprid, and he used an xml based application config. We are talking back in early 2007 when it was the wild west for ZF. Since then, I only see people using ini files.
Well, here it finally is, the official synthetic Zend_Config benchmark shootout.
After some frustration I learned from a forum post that the default password time limit for Oracle 11g is 120 days. Once you get close to that you will go into a grace period, where PHP’s oci connection dies on you with no explanation. You will notice a message like this in you apache log:
- [notice] child pid NNNN exit signal Bus error (10) in the apache log.
Step 1: Change your password, or rather lets just keep it as it is…
- ALTER USER myname IDENTIFIED BY mypassword
Step 2: Make us not have to do this again:
- ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
Hope this helps someone.
tek11 Winner
My brother and I got 1st place in the Tropo hackathon at phptek11. If you want to read the rules they were here. We won a Parrot AR.Drone Quadricopter for making a two-factor authentication system using Tropo’s apis.