doucha5080 2010-06-16 02:40
浏览 38
已采纳

是什么导致Apache2在此配置文件中将PHP显示为纯文本?

I am trying to run PHP and Rails in the same virtual host, however, PHP is being displayed as plain/text. When I create a test host without all the rewrites and proxy-ing, Apache2 will process the PHP as desired. Where in my config file have I gone wrong?

<VirtualHost *:80>
  #ServerName staging.domain.com
  #ServerAlias www.domain.com

  DocumentRoot /home/demo/vhosts/domain/public

  <Directory />
    Options FollowSymLinks
    AllowOverride None
  </Directory>

  <Directory /home/demo/vhosts/domain/public>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
  </Directory>

  RewriteEngine On

  <Proxy balancer://thinservers>
    BalancerMember http://127.0.0.1:5000
    BalancerMember http://127.0.0.1:5001
    BalancerMember http://127.0.0.1:5002
  </Proxy>

  # Redirect all non-static requests to thin
  RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
  RewriteRule ^/(.*)$ balancer://thinservers%{REQUEST_URI} [P,QSA,L]

  ProxyPass / balancer://thinservers/
  ProxyPassReverse / balancer://thinservers/
  ProxyPreserveHost on

  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>

  # Custom log file locations
  ErrorLog  /home/demo/vhosts/domain/log/error.log
  CustomLog /home/demo/vhosts/domain/log/access.log combined

</VirtualHost>
  • 写回答

1条回答 默认 最新

  • dongyan8929 2010-06-16 03:02
    关注

    Check your httpd.conf file and make sure it is loading the php5 module or if you use mod_suphp, make sure youre not loading both.

    <Directory "/var/www/myrailsapp/public/">
            Options Indexes +ExecCGI FollowSymLinks 
            Order allow,deny
            Allow from all
    </Directory>
    

    This is more of a http://www.serverfault.com question ...

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 关于#qt#的问题:Qt代码的移植问题
  • ¥50 求图像处理的matlab方案
  • ¥50 winform中使用edge的Kiosk模式
  • ¥15 关于#python#的问题:功能监听网页
  • ¥15 怎么让wx群机器人发送音乐
  • ¥15 fesafe材料库问题
  • ¥35 beats蓝牙耳机怎么查看日志
  • ¥15 Fluent齿轮搅油
  • ¥15 八爪鱼爬数据为什么自己停了
  • ¥15 交替优化波束形成和ris反射角使保密速率最大化