Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:tenderlove/phuby

* 'master' of github.com:tenderlove/phuby:
  clean up and fixes
  Fixed instructions
  • Loading branch information...
commit 7052fc8fedf3ecce2f8dffd5577dacf6f203040f 2 parents 73a5739 + 334bb3d
Aaron Patterson authored
Showing with 21 additions and 13 deletions.
  1. +12 −4 README.rdoc
  2. +1 −4 bin/phuby_server
  3. +8 −5 ext/phuby/extconf.rb
16 README.rdoc
View
@@ -30,15 +30,21 @@ Phuby wraps PHP in a loving embrace. Exposes a PHP runtime in ruby
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 iconv
+
=== Install MySQL with macports
$ sudo port install mysql5 mysql5-server
Set some symbolic links:
- $ 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
+ $ cd /opt/local
+ $ sudo ln -s mysql5/mysql include/mysql
+ $ sudo ln -s mysql5/mysql/libmysqlclient.15.dylib lib/libmysqlclient.dylib
=== Patch and configure php
@@ -46,6 +52,8 @@ 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 \
@@ -66,7 +74,7 @@ Then, either install the gem, or rake test
(The MIT License)
-Copyright (c) 2009 FIX
+Copyright (c) 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
5 bin/phuby_server 100644 → 100755
View
@@ -4,10 +4,7 @@ require 'rubygems'
require 'phuby'
require 'webrick'
-s = WEBrick::HTTPServer.new(
- :Port => 10101,
- :DocumentRoot => ARGV[0]
-)
+s = WEBrick::HTTPServer.new(:Port => 10101, :DocumentRoot => ARGV[0])
s.mount('/', Phuby::PHPHandler)
13 ext/phuby/extconf.rb
View
@@ -4,18 +4,21 @@
require 'mkmf'
-php_inc, php_lib = dir_config('php5', '/usr/local/include', '/usr/local/lib')
+config = Dir["/{usr,opt}/local/bin/php-config"]
+prefix = `#{config} --prefix`.chomp
-$INCFLAGS = "-I#{File.join(php_inc, 'php')}".quote + " #{$INCFLAGS}"
+php_inc, php_lib = dir_config("php5", "#{prefix}/include", "#{prefix}/lib")
+
+$INCFLAGS = "-I#{File.join(php_inc, "php").quote} #{$INCFLAGS}"
%w{ Zend TSRM main }.each do |dir|
- $INCFLAGS = "-I#{File.join(php_inc, 'php', dir)}".quote + " #{$INCFLAGS}"
+ $INCFLAGS = "-I#{File.join(php_inc, "php", dir).quote} #{$INCFLAGS}"
end
-unless find_library('php5', 'php_embed_init', php_lib)
+unless find_library("php5", "php_embed_init", php_lib)
abort "php is missing!"
end
-create_makefile('phuby/phuby')
+create_makefile("phuby/phuby")
# :startdoc:
Please sign in to comment.
Something went wrong with that request. Please try again.