Unable to render php files in browser
I am very new to php, and I am trying to develop a facebook application using php. I am using Joyent as my hosting platform.
Currently, I am trying to do some simple scripts in php and then build on them. However I am unable to see any php files being rendered properly in my application.
For eg: I have a simple script called phpinfo.php:
If I execute this on terminal like php phpinfo.php , I can see all the configurations. However if I try to access the same file as http://xxxxxx.facebook.joyent.us/phpinfo.php, I get : Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request.
Even if I rename this file to index.php its still the same. However I am able to access other html files [index.html] on the same location .
These are some of my php settings: These are some of the settings:
[fbkusoni:~/web/public] aafhe7vh$ php phpinfo.php | grep On
allow_url_fopen => On => On
auto_globals_jit => On => On
enable_dl => On => On
file_uploads => On => On
ignore_repeated_errors => On => On
ignore_repeated_source => On => On
implicit_flush => On => On
log_errors => On => On
register_argc_argv => On => On
report_memleaks => On => On
y2k_compliance => On => On
Multibyte regex (oniguruma) backtr开发者_开发技巧ack check => On
mysql.allow_persistent => On => On
session.bug_compat_warn => On => On
session.use_cookies => On => On
suhosin.cookie.cryptdocroot => On => On
suhosin.cookie.cryptua => On => On
suhosin.mt_srand.ignore => On => On
suhosin.protectkey => On => On
suhosin.server.encode => On => On
suhosin.server.strip => On => On
suhosin.session.cryptdocroot => On => On
suhosin.session.cryptua => On => On
suhosin.session.encrypt => On => On
suhosin.srand.ignore => On => On
suhosin.stealth => On => On
The answer might be very naive, but I am just trying to get started and looking for any suggestions regarding this and also using Joyent and cakephp to develop facebook applications.
Thanks.
Is your script executable (chmod +x phpinfo.php
)?
What does the web server error log say?
PHP may not be installed as an Apache module correctly. You can run it on the command line because that's in CGI mode & doesn't need Apache. Run apachectl configtest to see if there's anything wrong with the Apache configuration.
Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request.
This may indicate a syntax error in your code.
Try doing a php -l <filename>
from the command line for each of your scipt files to verify that they don't contain any syntax errors
精彩评论