Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

[SOLVED] The requested URL /signup was not found on this server

Hi, I'm trying the Phalcon web tutorial (http://docs.phalconphp.com/en/latest/reference/tutorial.html).

I successfully display the index page.

However, when I try to access the signup page (for which I created the /app/controllers/SingupController.php as well as the /app/views/signup/index.phtml), I run into the following message:

The requested URL /signup was not found on this server.

I can't figure out what I am doing wrong; maybe something in my virtual host setup or .htaccess file?

Next here's my setup:

MY SETUP

  • I'm running it on a local apache2 server on Ubuntu 12.04.

  • I set up a HOSTS ENTRY in /etc/hosts:

    127.0.0.1 phalcon-tutorial

  • I set up the following APACHE VIRTUAL HOST in /etc/apache2/sites-available:
<VirtualHost *:80>

    ServerAdmin [email protected]
    ServerName phalcon-tutorial

    DocumentRoot /var/www/phalcon-tutorial/public

    <Directory "/var/www/phalcon-tutorial">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    <Directory "/var/www/phalcon-tutorial/public">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/phalcon-tutorial-error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/phalcon-tutorial-access.log combined

</VirtualHost>

I created the following .htaccess file:

#/.htaccess
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule  ^$ public/    [L]
    RewriteRule  (.*) public/$1 [L]
</IfModule>

#/public/.htaccess
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
</IfModule>

Could anyone help me please?

Than you very much!

Andrea



6.4k

@andyk72 Did you mistype the filename in your question above "SingupController.php" only, or is it misspelled in your project as well?



49.2k

It's only mystyped in my post, sorry guys :-); in the project the file is SignupController.php



49.2k
Accepted
answer

Solved! I had to activate the apache rewrite engine module with the shell command:

a2enmod rewrite

I'm used to XAMPP on windows where mod_rewrite comes activated right out of the box; my ubuntu apache2 installation, on the contrary, did not activate the mod_rewrite by default.

Thank you metalb for the kind attention! Bye