Phuby wraps PHP in a loving embrace. Exposes a PHP runtime in ruby
php = Phuby::Runtime.new php.start php.eval('$hello = "world"') assert_equal "world", php['hello'] php.stop
The following instructions apply to OS X (probably not needed on linux):
DO NOT change the prefix… No, I don't know why yet.
Install iconv with macports
$ sudo port install libiconv
Install MySQL with macports
$ sudo port install mysql5 mysql5-server
Set some symbolic links:
$ cd /opt/local $ sudo ln -s /opt/local/include/mysql5/mysql /opt/local/include/mysql $ sudo ln -s /opt/local/lib/mysql5/mysql/libmysqlclient.15.dylib \ /opt/local/lib/libmysqlclient.dylib
Patch and configure php
If you're on OS X, apply php.patch to the downloaded php. Then configure php with the proper flags. These paths are for OS X, but you should be able to adjust them for linux:
$ patch -p0 < ../path/to/php.patch $ ./configure --enable-debug \ --enable-embed \ --disable-cli \ --with-mysql=/opt/local \ --with-mysqli=/opt/local/lib/mysql5/bin/mysql_config \ --with-mysql-sock=/opt/local/var/run/mysql5/mysqld.sock \ --prefix=/usr/local $ make && sudo make install
Then, either install the gem, or rake test
(The MIT License)
Copyright © Aaron Patterson and Ryan Davis of Seattle.rb
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.