Why don't my PHP scripts run under my web server?
First, check the various PHP or Apache (or whatever web server you are using) forums and FAQs. In addition, here are a few tips specific to Apache > PHP.
- Did you build Apache with the PHP module?
- Make sure Apache knows what to do with a PHP script. You need to tell Apache in
httpd.conf(or one of the other config files) that PHP files (.phtml,php3,php4,php5,php7,phps, and so on) should be passed to PHP. You do this with lines like these:AddType application/x-httpd-php5 AddType application/x-httpd-php5 .phtml
These lines tell Apache to pass files ending in
.php5and.phtmlto PHP for processing. - Check you can run a simple PHP script. Create a file called
test.php5in thehtdocsdirectory of your web server containing:<html> <head> <title>Test</title> </head> <body> <p> You should get PHPinfo below: <? phpinfo(); ?> </body> </html>Then go to the URL
http://my_web_server/test.php5(replacemy_webserverwith the appropriate machine and domain name) in your browser to find out if you get a page of PHP information back. If you don't, something far more serious is wrong with your Apache > PHP configuration than not being able to make ODBC connections from PHP through an ODBC driver.
If all the above is OK, you can try the following:
- Examine your Apache error log. This file is named in your Apache configuration file(s) (for example,
httpd.conf) with theErrorLogsetting. - Make sure you follow the instructions in the PHP
INSTALLfile and copy the sample PHP.inifile (for example,php5.ini-dist) to the correct location. Some options in this file can prove useful for debugging:track_errors = Onstores the last error in thephp_errormsgvariable.error_reporting = 7outputs normal errors, normal warnings, and parser errors.error_log = filenamedefines the file errors and warnings are sent to.
If PHP appears to be working, but you do not get data back through your Easysoft ODBC driver, refer to the instructions for turning on logging in the relevant Easysoft product documentation.