Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP PHP User Authentication Building the Library HTTP Foundation

Ronaldo Fialho
Ronaldo Fialho
5,105 Points

Symfony HTTP_NOT_FOUND

<?php require DIR . '/vendor/autoload.php';

$response = \Symfony\Component\HttpFoundation\Response::Create( null, \Symfony\Component\HttpFoundation\Response::HTTP_NOT_FOUND, ['Location' => "/not_found.php"]); $response->send(); exit;

What's wrong here??? I am being redirected to not found page!

index.php
<?php
require __DIR__ . '/vendor/autoload.php';

 $response = \Symfony\Component\HttpFoundation\Response::Create(
   null, \Symfony\Component\HttpFoundation\Response::HTTP_NOT_FOUND, ['Location' => "/not_found.php"]);
 $response->send();
 exit;
Stephen Limmex
Stephen Limmex
32,604 Points

Ronaldo,

I have not yet studied that course thus I am not sure of your answer but will try to help as you asked me to answer the question. I did find the following stackoverflow link which you may find helpful:

http://stackoverflow.com/documentation/composer-php/5915/auto-loading-with-composer#t=20170327164506092019

Good luck, Stephen

2 Answers

Simon Coates
Simon Coates
28,694 Points

It likes "create" not "Create". ( for future users. I assume Ronaldo isn't still staring at this code on a screen with a growing sense of despair)

Ronaldo Fialho
Ronaldo Fialho
5,105 Points

Ok, I'll check it out! Thx Stephen for your time!!