Jump to content

PHP Apache Configuration


Paul1999

Recommended Posts

Hi

Im trying to set up a local version of my website for offline development on my mac, I have configured php and set up apache server using localhost:8080 but for some reason I cant access any links from the home page. I have changed the reference for the root directory as below:

 

<?php

//define('ROOT', 'c:/laragon/www/papyrus');
define('ROOT', '/usr/local/var/www');
// require '/home/evanvkrp/public_html/christopherknight.co.uk/config.php';

require ROOT.'/res/helpers/functions.php';
require ROOT.'/res/helpers/url-manager.php';
require ROOT.'/res/partials/page-manager.php';

?>


<!-- html
-------------------------------------------- -->


<!DOCTYPE html>
<html lang="en">


<!-- head
-------------------------------------------- -->


<head>

    <!-- meta -->
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <!-- css -->
    <link href="/css/reset.css" rel="stylesheet">
    <link href="/css/slick.css" rel="stylesheet">
    <link href="https://use.typekit.net/saj6qqt.css" rel="stylesheet">
    <link href="/css/app.css" rel="stylesheet">

    <script src="/js/jquery-3.4.0.min.js"></script>
    
    <title><?= $pages[$page]['name']; ?></title>

</head>


<!-- content
-------------------------------------------- -->


<body>

    <!-- menu icon -->
    <div class="menu-icon-cont wrap-padding">
        <div class="menu-icon hamburger">
            <div class="slice-1"></div>
            <div class="slice-2"></div>
        </div>
    </div>

    <?php include ROOT.'/res/partials/menu.php'; ?>
    <?php include ROOT.'/res/partials/header.php'; ?>

    <?php include $path_to_page.'/content.php'; ?>

    <div id="page-<?= $page; ?>" class="page">
        <?php include $path_to_page.'/index.php'; ?>
        <?php include 'res/partials/footer.php'; ?>
    </div>


    <!-- javascript
    -------------------------------------------- -->


    <script src="/js/functions.js"></script>
    <script src="/js/fade-in-scroll.js"></script>
    <script src="/js/slick.min.js"></script>
    <script src="/js/slider.js"></script>
    <script src="/js/fade-in-config/global.js"></script>
    <!-- <script src="/js/fade-in-config.js"></script> -->
    
    <!-- load page-specific scripts -->
    <?php if($page === 'contact-us'): ?>
        <script src="/js/validate.min.js"></script>
    <?php endif; ?>
    <?php if(file_exists(ROOT.'/js/pages/'.$page.'.js')): ?>
        <script src="/js/pages/<?= $page ?>.js"></script>
    <?php endif; ?>
    <?php if(file_exists(ROOT.'/js/fade-in-config/'.$page.'.js')): ?>
        <script src="/js/fade-in-config/<?= $page ?>.js"></script>
    <?php endif; ?>
        
    <script>

        $(function() {

            $('.menu-icon').on('click', function() {

                var hidden = $('#main-menu').hasClass('menu-hidden') ? true : false;

                if(hidden)
                {
                    $(this).removeClass('hamburger').addClass('cross');
                    $('#main-menu').removeClass('menu-hidden').addClass('menu-visible');
                }
                else
                {
                    $(this).removeClass('cross').addClass('hamburger');
                    $('#main-menu').removeClass('menu-visible').addClass('menu-hidden');
                }

            });

        });

    </script>

</body>

</html>

Link to comment
Share on other sites

You've said what you can't do, but haven't mentioned what happens when you try. You've also posted some code, but not the code that actually includes the links in question.

How about a little more description about what's going wrong first before we worry about the code?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.