dongritan5654 2017-05-05 20:59
浏览 30
已采纳

图像未在生产中显示

So I took my site live and I see there are images missing and I am unclear as to whether it is a permissions issue or I am not referencing the file structure correctly. In terms of file structure, this is the header.php file inside of includes folder inside of public_html:

<?php
        $companyName = 'MicroUrb';
        include('includes/arrays.php');
?>

<!DOCTYPE html>
<html>
<head>
        <title><?php echo TITLE; ?></title>
        <link rel="stylesheet" href="assets/styles.css">
</head>
<body id="final-example">
        <div class="wrapper">
                <div id="banner">
                        <a href="/" title="Return to Home">
                                <img src="assets/img/banner0.jpg" alt="MicroUrb">
                                <div id="banner__text-content">
                                        <h1 id="banner__title">MicroUrb</h1>
                                </div>

                        </a>
                </div><!-- banner -->

                        <div id="nav">
                                <?php include('includes/nav.php'); ?>
                        </div><!-- nav -->

                                <div class="content">

In terms of permissions, I followed this guide, the answer with 239 votes:

https://superuser.com/questions/19318/how-can-i-give-write-access-of-a-folder-to-all-users-in-linux

I have played around with adding forward slash and other derivations in the code and it has not changed anything. So its grabbing the styles inside of assets but its not grabbing the images inside the images folder which is inside of assets.

  • 写回答

2条回答 默认 最新

  • dongping9475 2017-05-05 23:51
    关注

    So after some research I learned that ownership should be $USER:www-data - your user = owner and the web server = group owner

    sudo chown -R $USER:www-data /path/to/your_site.com/
    

    After performing the above command in terminal, I refreshed the page and problem solved.

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

报告相同问题?

悬赏问题

  • ¥15 linux驱动,linux应用,多线程
  • ¥20 我要一个分身加定位两个功能的安卓app
  • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果
  • ¥15 IAR程序莫名变量多重定义
  • ¥15 (标签-UDP|关键词-client)
  • ¥15 关于库卡officelite无法与虚拟机通讯的问题
  • ¥15 目标检测项目无法读取视频
  • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
  • ¥100 求采集电商背景音乐的方法
  • ¥15 数学建模竞赛求指导帮助