2

If I open this file (code below) with browser (through localhost/file.php), everything works as it is supposed to. But when using Coda Preview feature, it shows errors for each include:

Warning: include(./sections/title.php): failed to open stream: No such file or directory in - on line 4 Warning: include(): Failed opening './sections/title.php' for inclusion (include_path='.:') in - on line 4

Warning: include(./sections/form.php): failed to open stream: No such file or directory in - on line 10 Warning: include(): Failed opening './sections/form.php' for inclusion (include_path='.:') in - on line 10

How can I fix this issue with Coda Preview?

<html>
<head>
    <?php
        include("./sections/title.php");
    ?>
</head>
<body>
<p>Form 1</p>
    <?php
        include("./sections/form.php");
    ?>
</body>
</html>
Martin Tournoij
  • 26,737
  • 24
  • 105
  • 146
nolem
  • 105
  • 10

1 Answers1

-1

Coda needed some configuring, instructions:

  • Set the Local Root first by clicking the “Set” button and navigating to the “htdocs” folder that MAMP should have created when you installed it. The path should be Applications/MAMP/htdocs. Create a new folder within the htdocs folder and choose it as the Local Root.
  • Now set the Local URL as http://localhost/the_name_of_the_folder.
  • You can fill out the other two fields, Root URL (the URL it uses to make an icon for your site) and Remote Root (for uploading to a remote server when you’re ready to go live), if you want but you can leave them blank for local development purposes.
  • Now save the site and you should be good to go. If includes still don’t work, try restarting Coda 2 and MAMP.

Source

nolem
  • 105
  • 10