2015-01-05 2 views
0

Prestashop (v 1.6.0.9)을 새로 설치 한 후 웹 서비스 기능을 사용 가능하게하는 데 몇 가지 문제가 발생했습니다.웹 서비스가 새로 설치 작업을하지 않습니다

I 키를 설정하고 내가 URL

http://example.com/webservice/dispatcher.php?ws_key=my_key

그리고 관련 결과의 3을 사용하여 사용 가능한는 WS 년대를 확인할 수 있어요는 다음과 같습니다

http://example.com/api/employees?schema=synopsis

http://example.com/api/employees

http://example.com/api/employees?schema=blank

위의 링크를 테스트하면 메시지가 나타납니다. 이 페이지는 사용할 수 없습니다. 내 얼굴에 맞습니까? 이 추가적으로 내용

, 난 내가 내 루트 폴더에 PSWebServiceLibrary.php 파일을 다운로드 한 Web Service Tutorial의 단계를 따라, 나는 또한 내용에 테스트 파일 생성 :

<?php 
/** 
* Created by PhpStorm. 
* User: thales.pereira 
* Date: 05/01/15 
* Time: 16:10 
*/ 
require_once('./PSWebServiceLibrary.php'); 

$shop_url="http://localhost"; 
$secret_key="the_key"; 
$debug=false; 
try { 
    $webService = new PrestaShopWebservice($shop_url, $secret_key, $debug); 

    $opt['resource'] = 'customers?schema=synopsis'; 
    $xml = $webService->get($opt); 
    echo $xml; 
} 
catch (PrestaShopWebserviceException $ex) { 
    echo 'Other error: <br />' . $ex->getMessage(); 
} 

을하지만 잘 있습니다 .. 결과 :이 dev에 환경의

Other error: 
This call to PrestaShop Web Services failed and returned an HTTP status of 404. 
That means: Not Found. 

, 내가 가장 큰 문제는 nginx를 정규식 규칙이었다 MAMP 버전 3.0.7.3

답변

0

을 사용하고 있습니다. 여기

현재 나를 위해 무엇을 노력하고 있습니다 :

server { 

    listen 80; 

    server_name 127.0.0.1; 
    access_log /var/log/nginx/prestashop.access.log; 
    error_log /var/log/nginx/prestashop.error.log; 
    root /var/www/prestashop; 

    if ($http_host != "127.0.0.1") { 
    rewrite^http://127.0.0.1$request_uri permanent; 
    } 

    index index.php index.html; 

    location = /favicon.ico { 
    log_not_found off; 
    access_log off; 
    } 

    location = /robots.txt { 
    allow all; 
    log_not_found off; 
    access_log off; 
    } 

    # Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac). 

    location ~ /\. { 
    deny all; 
    access_log off; 
    log_not_found off; 
    } 

    rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last; 
    rewrite ^/([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$1$2$3.jpg last; 
    rewrite ^/([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$1$2$3$4.jpg last; 
    rewrite ^/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$1$2$3$4$5.jpg last; 
    rewrite ^/([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg last; 
    rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg last; 
    rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg last; 
    rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg last; 
    rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg last; 
    rewrite ^/c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ /img/c/$1$2$3.jpg last; 
    rewrite ^/c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ /img/c/$1$2.jpg last; 
    rewrite ^/images_ie/?([^/]+)\.(jpe?g|png|gif)$ /js/jquery/plugins/fancybox/images/$1.$2 last; 

    try_files $uri $uri/ /index.php$is_args$args; 

    error_page 404 /index.php?controller=404; 

    location ~* \.(gif)$ { 
    expires 2592000s; 
    } 

    location ~* \.(jpeg|jpg)$ { 
    expires 2592000s; 
    } 

    location ~* \.(png)$ { 
    expires 2592000s; 
    } 

    location ~* \.(css)$ { 
    expires 604800s; 
    } 

    location ~* \.(js|jsonp)$ { 
    expires 604800s; 
    } 

    location ~* \.(js)$ { 
    expires 604800s; 
    } 

    location ~* \.(ico)$ { 
    expires 31536000s; 
    } 

    location ~ \.php$ { 
    try_files $uri =404; 
    include /etc/nginx/fastcgi_params; 
    fastcgi_pass unix:/var/run/php5-fpm.sock; 
    fastcgi_index index.php; 
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
    fastcgi_intercept_errors on; 
    } 

} 
관련 문제