Jump to content


Photo

Mvc problem when deploying another pc


  • Please log in to reply
6 replies to this topic

#1 FatihEgbatan

FatihEgbatan

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 03 April 2013 - 11:27 AM

Hello,

 

I have been watching mvc tutorials and i managed to make something that i wanted by adding into it. 

 

i can use it like i want on my development pc(windows), but when i try to upload it to another pc(linux ubuntu or debian) i can not make it work :(

 

when i enter http://localhost/mvc/ it enters index php and redirects to http://localhost/mvc/login as intended. but after directing it gives me "Not found the requested URL mvc/login was not found on this server".

 

After searching a little i found that i couldnt get the url entered, $_GET[url] is always empty even after redirection.

I am thinking that .htaccess is the problem but i can not find what to do..

 

my current .htaccess is 

 

 

php_flag display_errors on
php_value error_reporting 9999
 
RewriteEngine On
RewriteBase /mvc/
 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
 
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
 
Thanks in advance !


#2 Simi

Simi

    Member

  • Members
  • PipPip
  • 12 posts
  • LocationRomania

Posted 03 April 2013 - 01:11 PM

Is  rewrite mod turned on?

try a2enmod rewrite and restart apache



#3 FatihEgbatan

FatihEgbatan

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 03 April 2013 - 02:12 PM

i have turned it on and restarted apache but still same.. :(



#4 Simi

Simi

    Member

  • Members
  • PipPip
  • 12 posts
  • LocationRomania

Posted 03 April 2013 - 04:04 PM

Set AllowOverride All in your default site conf

 

and then restart apache

 

 

eg.: 

 

nano /etc/apache2/sites-available/default


<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride All
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

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

        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

 

When this directive is set to None, then .htaccess files are completely ignored. In this case, the server will not even attempt to read .htaccess files in the filesystem.

When this directive is set to All, then any directive which has the .htaccess Context is allowed in .htaccess files.



#5 FatihEgbatan

FatihEgbatan

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 04 April 2013 - 07:42 AM

I have done it already but nothing change.. i changed httpd.conf file with my wamp servers' file and then i can reach login page and it looks working but..

 

when i visit other pages it gives me some  variable errors in php pages.. so i am thinking my wamp servers apache version is 2.4.2 and php version is 5.4.3 and target computers apache is 2.2.20 and php is 5.3.2..

 

Do you think version difference may cause the problem? 

 

Thanks for answering !



#6 Jeff

Jeff

    Member

  • Members
  • PipPip
  • 14 posts
  • LocationWisconsin

Posted 06 April 2013 - 11:03 PM

The only version issues that would cause errors are deprecated notices.

What are the PHP errors?



#7 Alexander

Alexander

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 11 April 2013 - 03:03 PM

hey i have the same problem !

when i upload my mvc to my host it works correctly

but in my localhost i an errors






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users