Hosting php website

Asked

Viewed 241 times

1

I developed a php application and when hosting it, returns me the following problem.

Warning: require_once(service/Qualificacaoservice.php) [Function.require-Once]: failed to open stream: No such file or directory in /var/www/html/caipiraimoveis.com.br/web/Model/Indexmodel.php on line 5

Fatal error: require_once() [Function.require]: Failed Opening required 'service/Qualificacaoservice.php' (include_path='.:/usr/share/Pear') in /var/www/html/caipiraimoveis.com.br/web/Model/Indexmodel.php on line 5

The above directories are in place, on the localhost it works, do you need to do something on the web server? I am using Uol host

<?php 
 require_once 'viewsmodel/ImovelViewModel.php';
 require_once 'viewsmodel/ConsultaResumidaViewModel.php';

 require_once 'service/QualificacaoService.php';
 require_once 'service/UtilService.php';
 require_once 'service/YouTubeService.php';

 class IndexModel extends PersistModelAbstract {
  • No local machine use xammp

  • put line 5 of the code!!!

  • @James Welcome to Stack Overflow! You can [Dit] your question to provide additional information, such as your xammp comment. Read more on [Ask] to improve your question.

  • 3

    If the host is linux, check the name of the files/folders as it differentiates larger than minute files.

  • <?php&#xA;&#xA;require_once 'viewsmodel/ImovelViewModel.php';&#xA;require_once 'viewsmodel/ConsultaResumidaViewModel.php';&#xA;require_once 'service/QualificacaoService.php';&#xA;require_once 'service/UtilService.php';&#xA;require_once 'service/YouTubeService.php'; class Indexmodel extends Persistmodelabstract { Line is require_once 'service/Qualificacaoservice.php';

  • @lost think you got my problem, I’m new in php, and I’m using Windows to program, and Linux to host... ...

  • 2

    Or... instead of refactoring you can use an autoload and never go through this problem!

  • 1

    Tiago, the code here in the comments is hard to read. Please, edit the question to include these details.

  • @Premiere I believe he will have the same problem even using autoload.

  • @gmsantos By his own comment, the problem is already solved, I just indicated the autoload to improve the code of it avoiding include file by aquivo.

Show 5 more comments

3 answers

4


It is probably problem with file system, on a linux server the file system is case sensitive in windows not. Check that the file name and path are exactly the same.

0

Are these directories outside the web access directory? Try using at the beginning of the script

<?php 
  set_include_path(/var/www/html/viewsmodel/);
   set_include_path(/var/www/html/service/);

 require_once 'ImovelViewModel.php';
 require_once 'ConsultaResumidaViewModel.php';

 require_once 'QualificacaoService.php';
 require_once 'UtilService.php';
 require_once 'YouTubeService.php';

I assume that the paths in set_include_path are correct

-2

I had a similar problem and had to contact the server to give certain permissions that I could not configure through the control panel. But as far as I know, you should create the same database there on the server with the same name and with the same tables and fields. all the same.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.