2016-05-17 58 views
0

我想通過cURLIIS7中發佈數據。我的代碼在cakePHPcURL路徑不能在IIS7中工作

我在本地主機安裝IIS與端口8090,並給予網址爲cURL爲下這是可以正常使用:

http://localhost:8090/project/project_name/test_post 

我的問題是不具有端口I部署相同的代碼到其他系統的IIS

因此,我改變網址:

http://localhost/project/project_name/test_post 

但作爲 'localhost' 的不工作我得到的錯誤。

這是什麼問題?

我該如何解決這個問題?

回答

1

嗨,

是正確配置IIS 7中在CakePHP港口在另一個系統上並執行IIS 7的運行與正確的PHP版本?是否安裝了本地主機上的IIS7上的數據庫?在IIS 7上啓用mod_rewrite? web.config在IIS 7中更改了嗎?

<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 
    <system.webServer> 
     <rewrite> 
      <rules> 
       <rule name="Exclude direct access to webroot/*" 
        stopProcessing="true"> 
        <match url="^webroot/(.*)$" ignoreCase="false" /> 
        <action type="None" /> 
       </rule> 
       <rule name="Rewrite routed access to assets(img, css, files, js, favicon)" 
        stopProcessing="true"> 
        <match url="^(img|css|files|js|favicon.ico)(.*)$" /> 
        <action type="Rewrite" url="webroot/{R:1}{R:2}" 
         appendQueryString="false" /> 
       </rule> 
       <rule name="Rewrite requested file/folder to index.php" 
        stopProcessing="true"> 
        <match url="^(.*)$" ignoreCase="false" /> 
        <action type="Rewrite" url="index.php" 
         appendQueryString="true" /> 
       </rule> 
      </rules> 
     </rewrite> 
    </system.webServer> 
</configuration> 

也許你必須在IIS 7服務器上用正確的配置設置重建cakeApp。

class DATABASE_CONFIG { 
     public $default = array(
      'datasource' => 'Database/Mysql', 
      'persistent' => false, 
      'host'  => 'localhost', 
      'port'  => '8080' 
      'login'  => 'cakephpuser', 
      'password' => 'c4k3roxx!', 
      'database' => 'my_cakephp_project', 
      'prefix'  => '' 
     ); 

} 

,並檢查您cakeApp如果有這樣的事情:

$request = array(
    'method' => 'POST', 
    'uri' => array(
     'scheme' => 'http', 
     'host' => $notificationUrl, 
     'port' => 8080, 

問候

阿克塞爾·阿諾德班格特 - 黑爾措根拉特2016