doubeng3216 2015-08-15 21:43
浏览 225
已采纳

HTTP请求失败! 找不到HTTP / 1.1 404

I have imported my site from a local to a live server and this error has come up for only 4 of my images and it worked perfect on the local server.

Warning: getimagesize(http://localhost/theshavingsaloonNEW/wp-content/uploads/2015/08/step1.jpg) [function.getimagesize]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /nfs/c11/h03/mnt/206312/domains/theshavingsaloon.com/html/wp-content/plugins/wr-pagebuilder/shortcodes/image/image.php on line 223

Here is the if statement around line 223 if it helps

if ($image_file) {
    $image_id = WR_Pb_Helper_Functions::get_image_id($image_file);
    $attachment = wp_prepare_attachment_for_js( $image_id );
    $image_file = (!empty( $attachment['sizes'][$image_size]['url'])) ? $attachment['sizes'][$image_size]['url'] : $image_file;
    $data = getimagesize( $image_file );
    $width = $data[0];
    $height = $data[1];
    $html_elemments .= "<img width='{$width}' height='{$height}' src='{$image_file}'{$alt_text}{$class_img} />";
    $script = '';
    $target = '';
}
  • 写回答

3条回答 默认 最新

  • duanqian3464 2015-08-15 22:33
    关注
    http://localhost/theshavingsaloonNEW
    

    this is a localhost url rather than a production one. Try these options in order to solve:

    1. update wp address urls in the admin dashboard -> settings -> general, there are two to change.

    2. Perform a sqldump of the db and use a text editor to replace localhost with your domain and then re-upload.

    3. Download the current theme folder / child theme if you have custom templates or made the theme yourself and use a text editor to find any instances of http://localhost. Replace with get_site_url()./restofurl

    4. In future use a migrate plugin to make this easy, it will do the db work for you.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler