Require_once on ubunto does not work and returns no error

Asked

Viewed 79 times

2

Hello, I use the code below in windows and works perfectly, but when I use the ubuntu, the only error that returns is GET http://site.com/ 500 (Internal Server Error), already in windows works perfectly.

index php.

include 'home.php'

home php.

require_once DIR_FUNCS.'func.php';
  • What is the value of DIR_FUNCS?

  • @Andersoncarloswoss define ("DIR_FUNCS",'./'funcs/');, I’ve tried to put the straight way /var/www/site/funcs/func.php, but it didn’t work the same way.

  • There’s no syntax error there, is there? What ' before funcs?

  • Correcting, define ("DIR_FUNCS",'./funcs/');, I accidentally put in time to answer.

  • Have you tried inserting parentheses: require_once(...)?

  • @Andersoncarloswoss Already, it did not result in anything.

  • Where are you setting DIR_FUNCS? tenta so para teste no lugar de DIR_FUNCS.'func.php' colocar (_ _ DIR_ _.'/funcs/func.php') <-"obs:remove os espacos entre _ _ DIR _ _ o site nao esta deixando junto" isso se a pasta funcs ficar na mesma pasta que home.php

  • I was doing some tests and returned a new error Failed to load resource: the server responded with a status of 500 (Internal Server Error), I don’t know if that helps.

  • error 500 is usually permission error

  • Indeed, I gave the necessary permissions, and returned to that error GET http://site.com/ 500 (Internal Server Error). Using xampp keeps giving the error, but works the same way.

Show 5 more comments

2 answers

1

I managed to solve by putting the absolute path of everything.

  • I do not think it is a good solution, tried the commands indicated by @Robson Jesus Omes ?

  • If that’s really the problem, set a course root to the app.

  • @Edilson how I could do that ??

  • @lazyFox I tried yes.

0

by ends go to the folder where the project is for example: cd /var/www/website make sure it’s root (Obs: sudo su to log in as root) apply the commands

 find . -type d -exec chmod 0755 {} \;

and

 find . -type f -exec chmod 0644 {} \;

if you continue to try find * instead of find .

So tell me what happened, I think you’ll solve it

Browser other questions tagged

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