patrickdlee / vagrant-examples

A collection of sample Vagrant configurations using Puppet. Starting out simple and getting more complex.
895 stars 319 forks source link

Example 5 #2

Open kklepper opened 10 years ago

kklepper commented 10 years ago

Thanks a lot, this is extremely helpful.

But some problems in Example 5: dynamic does not work.

How to see:

add

ini_set("display_errors", 1);

to public/index.php. You'll see why you didn't see anything: you have problems with mysql.

How to fix:

change @'%' to @'localhost' in dynamic.sql

DocumentRoot

DocumentRoot is not executed as given in dynamic-site.conf, so http://192.168.0.42/dynamic-site/ or http://myprecisebox/dynamic-site/ will show the directory structure of dynamic-site instead of dynamic-site/public/index.php

As a result, references to href in the html files fail. No idea how to fix this yet.

michaltakac commented 10 years ago

Few dirty moves, just to get it working in http://your.ip/dynamic-site/public...

Open /dynamic-site/application/views/additem.php

Change:

<form method="post" action="/add.php">

To:

<form method="post" action="/dynamic-site/public/add.php">

Same changes in other files edititem.php Change:

<form method="post" action="/edit.php?id=<?= $item->getId() ?>">

To:

<form method="post" action="/dynamic-site/public/edit.php?id=<?= $item->getId() ?>">

allitems.php Change:

...
        <td><a href="/edit.php?id=<?= $item->getId() ?>">edit</a></td>
...
<p><a href="**/**add.php">add new item</a></p>

To:

...
        <td><a href="/dynamic-site/public/edit.php?id=<?= $item->getId() ?>">edit</a></td>
...
<p><a href="/dynamic-site/public/add.php">add new item</a></p>

header.php Change:

<link rel="stylesheet" href="/assets/reset.css"/>
<link rel="stylesheet" href="/assets/dynamic.css"/>

To:

<link rel="stylesheet" href="/dynamic-site/public/assets/reset.css"/>
<link rel="stylesheet" href="/dynamic-site/public/assets/dynamic.css"/>

In /dynamic-site/public in add.php and edit.php, change all these lines:

header('location: /');

To:

header('location: /dynamic-site/public/');
michaltakac commented 10 years ago

Shouldn't be done like that

richardforth commented 8 months ago

^^^ Scam post ignore (dodgy link)

indradhanush commented 8 months ago

I reported the user with a link to this comment. Would suggest others do the same.

richardforth commented 8 months ago

Great, I can see its been removed, top job!