Yii Framework Forum: Getting 404 Errors on Server - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Getting 404 Errors on Server Rate Topic: -----

#1 User is offline   aaron907m 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 29-January 18

Posted 29 January 2018 - 03:32 AM

I am trying to install someone's github project who used Yii. I am getting 404 not found errors and need help fixing it.
My index.php comes up fine when I go here:
mydomain.com
But any urls in subdirectories fail with a 404 not found error.
For instance mydomain.com/stats gives the 404 error.
I am using lighttpd and php7. I don't see anything in the logs for either of those two programs.

Structure is like this:
My root is:
/var/yaamp/web/
The index.php lives there.
Then I have subdirectories called
/var/yaamp/web/assets
/var/yaamp/web/extensions
/var/yaamp/web/framework
/var/yaamp/web/images
/var/yaamp/web/yaamp


For the most part I think directly referencing files as they are in the directory structure works fine.
I can do mydomain.com/yaamp/modules/stats/test.php
or mydomain.com/images/41.png

But the original developer has lots of links that don't explicitly exist in the structure
so I'm not sure why it isn't working.
For instance mydomain.com/stats probably is referring to a file called
/var/yaamp/web/yaamp/modules/stats/index.php
I do get an error 500 when I try it like this:
mydomain.com/yaamp/modules/stats/index.php
also in that folder is a file that may be important called StatsController.php

The relevant section of my lighttpd.conf looks like this:
$HTTP["host"] =~ "mydomain.com" {
server.document-root = "/var/yaamp/web"
url.rewrite-if-not-file = (
"^(.*)/([0-9]+)$" => "index.php?r=$1&id=$2",
"^(.*)\?(.*)" => "index.php?r=$1&$2",
"^(.*)" => "index.php?r=$1",
"." => "index.php"
)
url.access-deny = ( "~", ".dat", ".log" )
}

If anyone is interested the Github repo I am trying to get working is here: github.com/tpruvot/yiimp

I just don't know what to do next. Please help!
0

#2 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 3,642
  • Joined: 16-February 11
  • Location:Japan

Posted 29 January 2018 - 05:21 AM

/* Moved from "2.0" to "1.1.x" */
The project globalzon/yaamp (https://github.com/globalzon/yaamp) which you forked is built on Yii 1.1.x, and your yiimp project also uses Yii 1.1.x.

IMO, the first thing you have to do is to read the Guide. (http://www.yiiframework.com/doc/guide/)
At the very least you have to read through the first 2 sections of it: "Getting Started" and "Fundamentals". Without the basic knowledge of the framework it's impossible for you to do something with it.
0

#3 User is offline   aaron907m 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 29-January 18

Posted 29 January 2018 - 10:18 AM

I am trying to install someone's github project who used Yii. I am getting 404 not found errors and need help fixing it.
My index.php comes up fine.
mydomain.com/
But any urls in subdirectories fail with a 404 not found error.
For instance mydomain.com/stats
I am using lighttpd and php7. I don't see anything in the logs
for either of those two programs.

Structure is like this:
My root is:
/var/yaamp/web/
The index.php lives there.
Then I have subdirectories called
/var/yaamp/web/assets
/var/yaamp/web/extensions
/var/yaamp/web/framework
/var/yaamp/web/images
/var/yaamp/web/yaamp


For the most part I think directly referencing files as they are in the directory structure works fine.
I can do mydomain.com/yaamp/modules/stats/test.php
or mydomain.com/images/41.png

But the original developer has lots of links that don't explicitly exist in the structure
so I'm not sure why it isn't working.
For instance mydomain.com/stats probably is referring to a file called
/var/yaamp/web/yaamp/modules/stats/index.php
I get an error 500 when I try it like this:
mydomain.com/yaamp/modules/stats/index.php
also in that folder is a file that may be important called StatsController.php

The relevant section of my lighttpd.conf looks like this:
$HTTP["host"] =~ "mydomain.com" {
server.document-root = "/var/yaamp/web"
url.rewrite-if-not-file = (
"^(.*)/([0-9]+)$" => "index.php?r=$1&id=$2",
"^(.*)\?(.*)" => "index.php?r=$1&$2",
"^(.*)" => "index.php?r=$1",
"." => "index.php"
)
url.access-deny = ( "~", ".dat", ".log" )
}

I just don't know what to do next. Please help!
0

#4 User is offline   Roberto Braga 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 216
  • Joined: 18-February 13
  • Location:Roma, Italy

Posted 29 January 2018 - 03:11 PM

It seem to me that your lighttpd URL rewrite is not working properly
Yii uses URL rewrite to manage URL in a single entrance point.
These URL are managed by yii routing system that execute a module and/or a controller and action.
When URL rewrite is properly configured all your URL should be like
Http://mysite.com/<c...oller>/<action>
Are you sure you are using lighttpd? Since log is empty maybe you have another webserver active.
0

#5 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 3,642
  • Joined: 16-February 11
  • Location:Japan

Posted 29 January 2018 - 05:33 PM

/* topics merged */
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users