Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

444
Visualizações
Paths are working on localhost but not on server

enter image description here

This is structure I have. Page add-product.php is in folder public_html. Partial page ConnectQuery.php I need to access is in folder partial. My project worked fine on localhost with wamp. Now I uploaded it to server and pathing got screwed. Error I get:

Warning: include(/storage/ssd3/728/17657728/public_html/partial/ConnectQuery.php): failed to open stream: No such file or directory in /storage/ssd3/728/17657728/public_html/add-product.php on line 13

Line 13 in add-product.php is

include __DIR__ . "/partial/ConnectQuery.php";

EDIT: There is one more error

Warning: include(): Failed opening '/storage/ssd4/729/17661729/public_html/partial/ConnectQuery.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /storage/ssd4/729/17661729/public_html/add-product.php on line 13
over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

Check the case in the spelling of the filename ConnectQuery.php. Is it maybe connectQuery.php (like you wrote in another question)? Or connectquery.php?

Windows ignores differences in the case of file names, Linux doesn't.

over 4 years ago · Santiago Trujillo Relatório

0

usually paths never work the same way unless the development machine and server OS are same and they handle directories and files the same way -

Say if your development machine is Windows your Drive C:// will be there its not the same in case of Linux and most of the servers are on linux and hence you're facing paths issue try using a path library in your case

in Node js there is path ; which will point to current directory from you're running your project and from there on the paths will work with no issues .

over 4 years ago · Santiago Trujillo Relatório

0

If you are using PHP <= 5.2 than you have to try as below

$dir = dirname(FILE); include($dir.'/partial/ConnectQuery.php');

Please try this and if you using some other php version than mention it here

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda