Hello! There is a site that works fine on a local server. When I upload a server to the web, a lot of errors come out. At first, I cursed that I did not see the files connected through require ... , when I changed the require to include everything more or less earned. Now the feeling that he does not see the files with functions. php version on local server and web server 5.6 . What could be the problem? Why does the local server work, on the web anymore? PS How can I check if I have specified the path to all files?
- Show the Apache logs. They should be available in the control panel or in the file /var/log/apache2/error.log - Nikita Vasilchenko
- And tell me what the site is built on? - Raz Galstyan
- @Razmik Galstyan, php 5.6, local server apache 2.4, if you had it in mind - r.mcreal
2 answers
The main mistakes of novice programmers, when you first upload PHP files to the hosting.
- Register. On Windows, it was not important, the line:
include'File.php';successfully find a file called "FiLe.Php". But on * nix hosting the file will not be found. - Difference of versions, new versions of PHP rarely appear on hosting.
- The difference settings. For example, can disable "exec", "mail".
- Modules that are locally connected are usually a lot of things "just in case." Far from all are connected to the hosting.
- Encoding. Always use UTF-8, otherwise there is a chance to get "hieroglyphs" or a blank page.
PS: Error reporting on hosting is usually turned off for security reasons. You can turn it on, or start using logs.
- and why these general tips? here is useful in relation to this issue only in paragraph 1. - teran
- There are no error details in the question. The general question is general advice. - Max
- Duck man has a problem with the ways and inclusions. what have the mail and the rest? - teran
Good afternoon, changing require to include does not help, so some functions do not work for you, since include from require is different in that require falls in Fatal error if the file cannot be connected for any reason. And include only issues Warning and quietly continues to work.
As for the problems on the server, first of all you need to register in any file:
phpinfo(); And check the information about the current state of PHP. In my opinion, the problem will be exactly this. It is also a good option to write a ticket to your host provider, explain your problem, and in most cases they tell you what is wrong.