user6586190
user6586190

Reputation:

Rails and PHP on one server

I have Apache server with installed PHP by default. There are several applications working on PHP, and I'm going to run there applications on Rails also.

  1. If I install also Ruby and Rails, may applications on PHP somehow interfere the applications on Rails?
  2. In Rails tutorial there is a command '>rails server' to run the server. If I already use the server for applications on PHP, should I use that command? If so, what would it do?

My appreciation for response.

Upvotes: 1

Views: 165

Answers (1)

7stud
7stud

Reputation: 48649

  1. A server like Apache handles requests. If you make a request to a php program, then the php program will execute. If you make a request to a ruby program (i.e. a rails program), then the ruby program will execute. Typically, you will add a shebang line to a ruby program:

    #!/usr/bin/env ruby
    

    so that the server knows to use ruby to execute the program.

  2. $ rails server starts the WEBrick server, which is a ruby server and has nothing to do with Apache.

Upvotes: 1

Related Questions