Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

1 Neutral

About montilla

  • Rank
  1. I got it! With your tips, I came to the .htaccess issues and studying deeper, I saw that I had to do the routes through it or using a framework that abstracted routes by setting few parameters in .htaccess. I used the Slim framework. Thank you all for the promptness! Strong hug! 😆😆😆
  2. But why locally does the project work perfectly? And if so, what setting should I set in this file? Whoever takes care of the routes is my Route.php, right?
  3. Updating: Composer is automatically changing my .htaccess by inserting the line "Deny from all"
  4. Continuing the answers: * My .htaccess is empty; * My index.php: <?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); require_once "../vendor/autoload.php"; $route = new \App\Route; ?> * I do not have frameworks, only Composer; * That. I have only the FTP user with active SSH, which is where I installed Composer. The homepage of the site is this: http://oficinadoalicatecertific.com.br/ When we click the "Entrar" button at the top right, the action triggers the address /autenticar, but it generates the 404 error. The home page comes from Route.php, but something does not let you recognize the other routes. Can you help me?
  5. Good afternoon! I got past the blank page. It was a problem installing Composer on the server. I can access the index, but the server is not recognizing the other directories in my Route.php file. You are returning a 404 error. Answering your questions: * Linux Apache CentOS Server 6.9 - Kinghost Hosting; * My composer.json: { "name": "miniframework", "require": { "php": ">= 5.6" }, "authors": [ { "name": "Fabio Faria", "email": "fabio-oliveri@hotmail.com" } ], "autoload": { "psr-4": { "App\\": "App/", "MF\\": "vendor/MF/" } } } * My autoload.php: <?php // autoload.php @generated by Composer require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInitf924af3bf344aef2d95a140d392154f6::getLoader(); * My Route.php: <?php //namespace correspondente ao diretório em que o arquivo está contido namespace App; use MF\Init\Bootstrap; class Route extends Bootstrap{ protected function initRoutes() { //configura array de rotas dos controllers $routes["home"] = array( "route" => "/", "controller" => "IndexController", "action" => "index" //action que será desparada no IndexController ); $routes["autenticar"] = array( "route" => "/autenticar", "controller" => "AuthController", "action" => "autenticar" //action que será desparada no AuthController ); $routes["laudos"] = array( "route" => "/laudos", "controller" => "AppController", "action" => "laudos" //action que será desparada no AppController ); $routes["sair"] = array( "route" => "/sair", "controller" => "AuthController", "action" => "sair" //action que será desparada no AuthController ); $routes["acao"] = array( "route" => "/acao", "controller" => "AppController", "action" => "acao" //action que será desparada no AppController ); $routes["buscar"] = array( "route" => "/buscar", "controller" => "AppController", "action" => "buscar" //action que será desparada no AppController ); $this->setRoutes($routes); } } ?> Right now, I'm grateful!
  6. I included the code without code, but the page remains blank with no reference at all. What do you indicate? Remembering that my index.php is not at the root of hosting.
  7. Good night! The context is that I use a shared hosting, and the folder available to the project is not the root of hosting. I researched other topics and will try to make some settings in the hosting tomorrow. I will come back with the results to share with you. I am from Brazil and our time zones should be different. Sorry for the divergence. My sincere thanks from now on. I hope to see you again and continue to help me on this journey. Big hug!
  8. Good morning, people! I'm having the following problem in my projectx in php: I created a project with Composer in php where I put php to listen to the public folder from the command prompt. However, when I upload the project to the site or to the xampp htdocs, the result of displaying the index (domain / projectx / public) is white. It does not display anything or any warning. Running with the php server via prompt listening directly to the public folder the project runs normally. The structure of the project is this (it has an attached image too): projeto x -App -Controller (folder with controllers) -Model (folder with models) -View (folder with views) -Connection (DB connection class) -Route (Class that manages the routes accessed in the browser and instantiates the necessary controllers) -public -.htaccess -index.php (Application start page that instantiates the Route class to determine the flow of the application) -vendor -composer (folder with composer files) -autoload.php composer.json composer.lock composer.phar When I include files in the public folder and access directly, the file works normally. That is, the server is listening to all folders. Could you help me with this? If I have to configure something on the server or in my project? I am new to PHP and would greatly appreciate your help. Right now, I'm grateful! Application running on the latest version of Composer. Tested on php version 5.6.40 and 7.1
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.