predefined routing is not working cakephp 3 - php

after I have installed a new LAMP Server I wanted to install cakephp3 on my server. So far everything works fine. I have generated the scaffold code explained in the beginner tutorial. After the code has been successfully generated I have noticed that the standard routing is not working, so I cannot call actions from controller, for example by typing http://adress/cakephp/Users/add. Instead of a error message occurs
"The requested URL /cakephp/Bookmarks was not found on this server."
This is irritating me, because I have also a MAMP Server on my MAC with a installed cakephp application and I didnt have errors like this. Thank you.

Related

Error when first launching symfony 4 project

I want to use Symfony 4.x for a new project, I have installed composer and used it to create a new project. My php version is 7.0.10 & I have wamp as well.
In this tutorial (https://symfony.com/doc/master/setup.html), it says after you run the server "Open your browser and navigate to http://localhost:8000/". When I do so, I get a No route found for "GET /" error.
the pictures bellow display what I get as an error more precisely :
as well as
I have installed everything following the guide on their official page. I have seen this problem being discussed on github (https://github.com/symfony/symfony-docs/issues/9178) but I don't understand their "quick fix" nor what they're talking about.
I want to know how to get my project running without that problem.
Thanks for any help
It’s strange but It’s totally normal and the error proved that Symfony is well installed
It’s not a « compile » or « configuration » error it’s just a logical error that means you don’t have route defined at
url / so keep learning and define a route (see doc and you see the result)

Not Found #404 Yii Framework on linux

In my local machine (Windows) my app made in Yii Framework works right, but on the server(Debian Linux) not works.
It always get the page Not Found (#404) Page not found.
The code is in https://github.com/LucasOlmedo/TCCFatecZL/tree/master/PROJETO_TCC_OFC
Can help me?

Codeigniter Rest Server denies just one request

TL;DR
I get a 404 (Not Found) error on calling an API method (api/auth/authenticated~GET). I only get this on my live-server, not on local and not on any other methods.
The Problem
I use Codeigniter with a Rest-Server library. I have a simple method api/auth/authenticated(GET) that returns true if the user is logged in and false if not. On the live-server this method gives me a 404 (Not Found) error. Other calls to the same api class work, for example api/auth/login(POST) works and api/auth/logout(GET) works as well.
so how is this possible?
I have tried to delete the .htaccess file, but that didn't work. It can't be a typo since it works locally. Maybe some setting in Apache? But then why do the other methods work just fine?
I would be grateful for any ideas and hints.
my app
CodeIgniter 3.0.3
CodeIgniter Rest Server
AngularJs 1.5 with ngResource for client-side
my server env
digital ocean droplet
Ubuntu 14.04
PHP 5.6.15
Apache 2.4.7
The worst problems are always the most stupid ones ...
There should be a list on my desk.
1. Check for typos (very important but was not the problem here)
Now if we are working on Windows or OSX and everything works fine and then some parts just don't work on Linux this one is very important:
2. Check filenames for case-sensitivity problems (also check the GIT config)
The Problem was still a bit harder to find. I use Git to push my live-deploybranch to my remote repository, which is then picked up by Deploybot and uploaded to my server. Git doesn't care about case sensitivity on default and files will stay like they were first added forever. Thanks to this post i could just type one command to change it.
git config core.ignorecase false

bootstrap.php.cache is missing

I have a problem with Symfony 2. trying the example from the book. I have written a controller but when i go to the URL specified in the route i get an error. The server can't find the page. When i run app_dev.php i get an error that the file boostrap.php.cache is missing.
searched on the internet but found nothing relevant so far. I don't know if the front-controller is already written or if that is something that still has to be done by me.
I can't get the application to run.
Found the solution. I followed the guidelines installing sf2 in netbeans. Instead of running the application as a local website i used the build-in server option wich gave me access to the cli commands. There i could use the command run server and all of my problems were gone.

Can't run tests provided in Slim Framework

I'm trying to make a simple rest client for my android app. I would like to do than in TDD way, but for that I need simple working configuration for all actions (GET, POST, and so on). After some struggling I was able to make test work with get requests. Unfortunately with Post routes things didn't go well. When testing (netbeans 8.0.2 + phpunit) on local server (xampp 5.6.3) all I get is 404 error. Same thing if I run method being tested with Advanced Rest Client Application (chrome extension). When I send my rest files to live hosting then method in question works as it should.
After searching for some days (read about everything with 404 errors on Slim Framework) I decided to start with something which should work right of the box. Slim framework comes with simple demo app and some tests. Here I have another error which prevents start of tests:
Fatal error: Class 'Slim\Middleware' not found in C:\xampp\htdocs\web\local\codeguy-Slim-04958a1\tests\MiddlewareTest.php on line 3
As far I can tell I have something wrong with my xampp server but I don't have any more ideas how to fix this. So If somebody could show me correct way to setup Netbeans, Xampp, Slim and phpunit(I'm running it from IDE (ALT + F6)) then I would be able to build my rest api on top of that.
I just tried the following, maybe it might suggest a different route to try?
git clone https://github.com/codeguy/Slim.git
cd Slim
// Edit composer.json to include "phpunit/phpunit": "4.3.*"
curl -sS https://getcomposer.org/installer | php
php composer.phar install
./vendor/bin/phpunit
A few tests failed for me, surprisingly - so that would need digging into. But all classes were found.
Everything should work though, as the project seems to be building OK over on Travis CI.
I've found out what was wrong with my tests and with test provided with framework. I didn't know that I had to set bootstrap.php file in Project configuration of Netbeans.

Categories