Twilio php api sms服务在localhost xampp windows上工作正常,但在实时IIS服务器上无效,它返回500错误代码

时间:2017-09-20 08:21:34

标签: php sms twilio-php

$app->get('/{_locale}/user/login', function(Request $request) use ($app) {
    return $app['twig']->render('login.html.twig', array(
        'error'         => $app['security.last_error']($request),
    ));
})->bind('login');


$app['security.firewalls'] = array(
    'login' => array(
        'pattern' => '^/(de|en|fr|es)/user/login$',
    ),
    'main' => array(
        'pattern' => '^.*$',
        'anonymous' => false,
        'remember_me' => array(),
        'form' => array(
        'login_path' => 'login',
        'check_path' => '/user/login_check',
        'post_only' => true,
        'with_csrf' => true,
        'default_target_path' => 'homepage'
    ),
    'logout' => array(
        'logout_path' => '/user/logout',
        'invalidate_session' => true,
    )
);

上面的代码发送SMS完美,但在Windows服务器上的IIS服务器上部署时不能在实时项目上工作。我看到很少有与此问题相关的帖子,但大多数人建议允许服务器上的curl。如果是这样,请告诉如何在IIS服务器上启用curl

1 个答案:

答案 0 :(得分:0)

问题出在IIS服务器上的SSL证书中。在twilio lib中打开TinyHttp.php:在library(ggplot2) library(reshape2) set.seed(66) Mydata <- sample(x=(-3:3),size = 840*12,replace = T) Mydata <- matrix(data=Mydata,nrow=840,ncol=12) Dates <- seq(from=1948+1/24, to= 2018,by=1/12) data.breaks <- c(-3.5,-2.5,-1.5,0,1.5,2.5,3.5) rownames(Mydata) <- Dates d <- melt(Mydata) colfunc = colorRampPalette(c("brown", "red", "yellow", "white")) ggplot(d, aes(Var1, Var2, z=value, fill = value)) + stat_contour(geom="polygon", aes(fill=..level..)) + scale_fill_gradientn(colours = colfunc(7), breaks=data.breaks, limits=c(-4,4), values=scales::rescale(data.breaks))+ theme_bw() + scale_x_continuous(name="", breaks=seq(1950,2010,20), expand=c(0,0)) + scale_y_continuous(name="time-scale", expand=c(0,0))+ guides(fill = guide_colorbar(barwidth = 2, barheight = 15)) 数组中添加CURLOPT_SSL_VERIFYPEER => FALSE