Apache with Typecho and wordpress in a subdirectory –"No input file specified."

I’m trying to move my site from wordpress to Typecho(This is a china CMS system) by change my VirtualHost in http.conf.To be more clearly,follow is the doc tree in my server.

|-yjdata
      |-www(where I want my site to be direct to)
         |-php-fpm-5.5.conf
         |-wordpress(where my site is used to be direct to)
            |-index.php
            |-wp-admin
            |-... ...
         |-typecho
            |-index.php
            |-install.php
            |-... ...

Before my http.conf looked like this.

<VirtualHost *:80>
    ServerName www.mydomain.com
    ServerAlias www.mydomain.com mydomain.com 
    DocumentRoot /yjdata/www/wordpress/
    ProxyPassMatch ^/(.*.php)$ fcgi://127.0.0.1:10000/yjdata/www/wordpress/$1
    DirectoryIndex index.html index.php
</VirtualHost>

Then I changed it as follow:

<VirtualHost *:80>
    ServerName www.mydomain.com
    ServerAlias www.mydomain.com mydomain.com 
    DocumentRoot /yjdata/www/
    ProxyPassMatch ^/(.*.php)$ fcgi://127.0.0.1:10000/yjdata/www/$1
    DirectoryIndex index.html index.php
</VirtualHost>

I also write a index.html file in the /www/ directory to show that if the set take effect and a php5.ini

// index file
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Congratulations!</title>
</head>
<body>
    Coming final.QAQ
    <a href="./wordpress/index.php">wordpress</a>
    <a href="./typecho/index.php">typecho</a>
</body>
</html>

php5.ini

cgi.fix_pathinfo = 1

Well, after restart my apache and change some static links in DataBasewordpress , the index file do take effect. And I also can get in the back-end pages and the artical’s pages without being redirected by wordpress.
However, while I tried to entry this link www.mydomain.com/typecho/orwww.mydomain.com/typecho/install.php, I still got “No input file specified.”
I guess it maybe due to the loss of .htaccess.So I created a .htaccessfile in thetypecho file directory but still got the same message.
This is the content of .htaccess.

<IfModule mod_rewrite.c>
DirectoryIndex index.php

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index.php|robots.txt)
RewriteRule ^(.*)$ index.php?/$1 [L]

Options +ExecCGI
addhandler x-httpd-php5-cgi .php
Header set Set-Cookie "language=%{lang}e; path=/;" env=lang
</IfModule>

By the way, in the Network tools in Chrome, I found that while I’m entrying thewww.mydomain.com/typecho/ link, it sent the cookie of wordpress, I used burp to clear it, but still no change.
The follow is what I also tried but without use.

In php.ini file.
Change cgi.fix_pathinfo=0 to cgi.fix_pathinfo=1

And in the end, this is the final doctree in my server.

|-yjdata
      |-www(where I want my site to be direct to)
         |-index.html
         |-php5.ini
         |-php-fpm-5.5.conf
         |-wordpress(where my site is used to be direct to)
            |-index.php
            |-wp-admin
            |-... ...
         |-typecho
            |-.htaccess
            |-php5.ini
            |-index.php
            |-install.php
            |-... ...

I have spent a whole day in this issue but still is failed.
Thanks for your help!

Read more here: Apache with Typecho and wordpress in a subdirectory –"No input file specified."

Leave a Reply

Your email address will not be published. Required fields are marked *