Question: |
Hello! I can`t deal with PHP.I save the script in file 1.php set the permission 755.If I place it in the directory cgi-bin and try to access via browser http://мойсайт/cgi-bin/1.php the server returns the 400 error, but if you are saving to the root directory and enter http://мойсайт/1.php then get the text of the script. What should I do to correctly run the script? Thank you. |
Answer: |
Hello. Why did you decide to set permissions 755 on the php file? It`s not a binary executable and does not squeak, what`s to run? File permissions should be 644. And cgi-bin do not touch, this folder you do not need. just kindly requested always to bring only http://мойсайт/1.php ?? such a reference can not exist, u is visit is a domain name |
Question: |
Right set 644.http://learnin.ru/1.php appears in the form of text. |
Answer: |
u text there is, the file is broken. It is neither php nor html document. what characters do you go before <? ? . where did you get this file? it is encrypted with zend or IonCube? |
Answer: |
Have you had a PTO in the file. I have removed it. check the script now. because the PTO improperly determined the file encoding. |
Question: |
This is a plain text file from notepad.exe which the Apache server runs as a php script without any problems. |
Answer: |
do Not use Notepad as it preserved this character in the beginning of the file. Use Notepad++ and save as encoding UTF8 without PTO. |
Answer: |
when we use notepad.exe look carefully as to save the file. in php files .and other files should not have BOM component |
Question: |
What is a BOM? How do I prevent it from appearing? |
Answer: |
Read the messages above. |
Question: |
OK thanks |
Answer: |
what is BOM http://www.olunka.ru/chto-takoe-bom-i-pochemu-on-poyavlyaetsya-kogda-ego-ne-zvali/ |