简体   繁体   English

Phalcon项目索引找不到控制器,并且找不到服务器错误404

[英]Phalcon project index cannot find the controller, and server error is 404 not found

I started this Phalcon project by following the tutorial , but Im having problem with controller. 我按照教程开始了这个Phalcon项目,但是我在控制器方面遇到了问题。 for example, I set up the exception in Index.php such as 例如,我在Index.php中设置了异常,例如

$application = new Application($di);

try {
// Handle the request
$response = $application->handle();

$response->send();

} catch (\Exception $e) {
    echo 'Exception: ', $e->getMessage();
}

so I am implementing this sign up function as following, in file signup/index.phtml 所以我要在文件signup / index.phtml中实现以下注册功能

<?php echo $this->tag->form("signup/register"); ?>

<p>
    <label for="name">Name</label>
    <?php echo $this->tag->textField("name"); ?>
</p>

<p>
    <label for="email">E-Mail</label>
    <?php echo $this->tag->textField("email"); ?>
</p>

<p>
    <?php echo $this->tag->submitButton("Register"); ?>
</p>

</form>

and in the root index.php, I have echo $this->tag->linkTo( 'signup', 'Sign Up Here!' ); 在根index.php中,我已回显$ this-> tag-> linkTo('signup','Sign Up Here!');

but when I click on "Sign Up Here!" 但是当我点击“在这里注册!” from web page I got the error says "Not Found The requested URL /signup was not found on this server." 从网页上,我收到错误消息“找不到此服务器上未找到请求的URL /注册”。

it is not even showing the exception I set in the beginning, I do know what is the problem why is this happening, I appreciate any help. 它甚至都没有显示我一开始设置的异常,我确实知道问题出在哪里,为什么会出现这种情况,感谢您的帮助。

then I tried to create a project by using Phalcon Developer tools with command phalcon create-project new_project I got error Segmentation fault: 11, does anyone know what is this mean? 然后我尝试通过将Phalcon Developer工具与命令phalcon create-project new_project一起使用来创建项目。我遇到错误分段错误:11,有人知道这是什么意思吗?

Thank you! 谢谢!

What is your address bar showing you after you clicked it? 单击后,您的地址栏显示什么?

From my experience, it usually has something to do with your base uri... 根据我的经验,它通常与您的基本尿液有关。

If you followed the tutorial strictly, make sure your base URI is set-up like this... 如果您严格按照本教程进行操作,请确保您的基本URI设置如下:

$di->set(
'url',
function () {
    $url = new UrlProvider();
    $url->setBaseUri('/');
    return $url;
}

); );

However, if you built your app using the Phalcon Devtools, go to app/config/config.php and refactor your base uri section to 但是,如果您使用Phalcon Devtools构建了应用程序,请转到app/config/config.php并将您的基本uri部分重构为

'baseUri' => '/'

For the segmentation issue, make sure that: 1) You are using PHP 7.2 or less. 对于细分问题,请确保:1)您使用的是PHP 7.2或更低版本。 PHP 7.3 support is still in the works... 2) You are using the latest version of Phalcon Devtools. PHP 7.3支持仍在进行中... 2)您正在使用最新版本的Phalcon Devtools。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Phalcon 找不到 controller。 未找到错误404 - Phalcon cannot find controller. Error 404 Not found 在Phalcon控制器中找不到模型 - Model cannot be found in Phalcon controller Phalcon - 如何在另一个 controller 中调用一个 model? “错误:Class 未找到” - Phalcon - How to call a model in another controller? "Error: Class not found" 404 错误:本地主机 MAMP 服务器找不到 javascript 文件 - 404 Error: localhost MAMP server cannot find javascript file Phalcon Devtools 错误:生成控制器、模型和脚手架不起作用(404 未找到页面) - Phalcon Devtools error: generate controllers, models and scaffold not working (404 not found page) 找到codeginiter控制器,但仍然出现404错误 - codeginiter controller found but still 404 error 找不到Phalcon Mongo类错误 - Phalcon Mongo Class not found error Phalcon:找不到页面错误处理程序 - Phalcon: not found page error handler 默认情况下,如何在HipHop / HHVM中解析服务器根目录中的index.php(并修复“找不到404文件”错误)? - How to parse index.php in server root by default in HipHop / HHVM (and fix the “404 File Not Found” error)? YiiBoilerPlate项目显示404找不到错误 - YiiBoilerPlate project showing 404 not found error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM