rack-legacy
rack-legacy copied to clipboard
PHP 5.4+ dependency
Great gem, thanks for providing. When I tried to install this today, I kept getting the php options list both when I started the WEbrick server and when I tried to run php files. After a little digging, it would appear that the '-S' server option was introduced in PHP 5.4 and our server was running 5.3. I think 5.3 is still pretty standard on RedHat servers, so it would probably be worth noting this in your Readme. If I'm wrong about the dependency, could you give me some guidance on what I've done wrong with my setup?
I also got the following error when using your syntax directly...
Original syntax from Readme:
config.middleware.insert_before
ActionDispatch::Static, Rack::Legacy::Php, Rails.public_path
Error:
=> Booting WEBrick
=> Rails 4.0.0 application starting in development on http://0.0.0.0:3001
=> Run rails server -h
for more startup options
=> Ctrl-C to shutdown server
Exiting
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/childprocess-0.5.5/lib/childprocess/abstract_process.rb:45:in `initialize': all arguments must be String: "php", "-S", "localhost:58301", "-t", #<Pathname:/[path to public dir]/public>
I simply added a to_s and it solved it.
config.middleware.insert_before
ActionDispatch::Static, Rack::Legacy::Php, Rails.public_path.to_s
Since I was making suggestions for the Readme, I thought I would include this too. It worked out well for me as this error helped me figure out the bigger error later.
As before, if this is a symptom of a larger problem with my setup, please let me know.
Thanks,
You are correct. Legacy versions of PHP that do not have the built-in webserver are no longer supported. You could use an older version of RackLegacy. In order versions I started a fresh PHP process with each request by executing the php-cgi. I will update the README to provide a bit of guidance on this. Thanks for the feedback.
Working perfect now that PHP 5.4 is installed. Thanks again.