0

I am coding using a Mac and running Mongrel using script/server. However, I inherited this code with some PHP scripts that runs within the application.

My question is, how do I run PHP alongside Mongrel?

Teej
  • 12,764
  • 9
  • 72
  • 93
  • What webserver setup are you using? How do you want the deploy to look like? (ie, which URLs or paths do you want mapped to Rails, and which to PHP?) – Chris Heald Jan 31 '11 at 16:59
  • I am just typing in 'script/server' which runs Mongrel. I cannot run PHP on it and couldn't work on the PHP code, which I need to do right now. I currently have something like this http://domain.com/php_scripts_folder/index.php – Teej Jan 31 '11 at 17:01
  • Mongrel runs ruby scripts. Usually, you would use Apache to run PHP scripts. They would both need to be run on different ports. Something I have done in the past is run php scripts from the rails public folder. But then you would need to run rails on Apache (I would recommend Passenger for this: http://www.modrails.com/) – ghoppe Jan 31 '11 at 20:00

1 Answers1

1

See here for running PHP:

Easiest way to activate PHP and MySQL on Mac OS 10.6 (Snow Leopard), 10.7 (Lion), 10.8 (Mountain Lion)?

Then, you can migrate the PHP code to Rails code at your leisure.

Community
  • 1
  • 1
jschorr
  • 3,034
  • 1
  • 17
  • 20
  • I know how to run PHP on a mac. – Teej Jan 31 '11 at 17:28
  • 2
    Sorry. When you run PHP, 127.0.0.1 (localhost defaulting to port 80), your PHP coded part should show up. Which script/server, it is normally at 127.0.0.1:3000, thus the Rails part running side-by-side. Please clarify the issue – jschorr Jan 31 '11 at 17:29