Smarty – What is needed for modules to run?

I’ve just got a new script using Smarty and I did setup a nginx VPS however the owner of the script said it only works on apache (didn’t question it).

I re installed the server but this time with Apache2 and the main page loads and DB connection is fine however when it tries to access a module it doesn’t work correctly.

For example this is a module for registrations (/module/register/) and the link to register is mysite.com/register/ which is meant to use the files in mysite.com/module/register/ but to stay with just /register URL.

However I’m just receiving a 404 saying mysite.com/register/ doesn’t exist (which is doesn’t) but it’s not using the correct directory.

On his demo sites this works fine however on mine it does not, he said this must be an issue with my server.

So my question is, what do I need to make sure I have on my server that allows smarty / modules / rewrites to run?

Answer

You can find requirements here:

http://www.smarty.net/docsv2/en/installation.tpl#installation.requirements

Requirements Smarty requires a web server running PHP 4.0.6 or
greater.

Nginx or Apache should work just fine.

The next step will be to properly include smarty in your scripts:

http://www.smarty.net/docsv2/en/installing.smarty.basic.tpl

URLs

I suspect the problem you are having is that you have not properly setup SEF URLs for whatever framework you are using. You will need to configure your web-server to do this (if you’re using a PHP framework it may already have a .htaccess file for Apache that you can configure or enable).

Attribution
Source : Link , Question Author : CustomNet , Answer Author : Community

Leave a Comment