0

I am trying to setup a mysql authorization function in my XAMPP php5.6 developer server. However, I can't get the server to start up. I have tried numerous variations to the code, including commenting out the lines beginning with DB. #ing them out makes the server start up, but gives a HTTP500 error when I try to view the pages requiring authentication, because it doesn't know what database to look in.

Apache/2.4.26 (Win32) OpenSSL/1.0.2l PHP/5.6.31

httpd.conf:

...

DBDriver mysql
DBDParams host=localhost,dbname=aDatabase,user=aUser,pass=ThisIsNotReallyMyPassword
<Directory "E:\xampp\htdocs\shouldnotbesecure\shouldbesecure">
    Options -Indexes
    AuthType Basic
    AuthName "Please Login"
    AuthBasicProvider dbd
    # mod_authz_core configuration
    Require valid-user
    AuthDBDUserPWQuery "SELECT password FROM users WHERE username = %s"
</Directory>

loaded in httpd.config (coming from phpinfo() command):

Loaded Modules
    core mod_win32 mpm_winnt http_core mod_so mod_access_compat mod_actions mod_alias mod_allowmethods mod_asis mod_auth_basic mod_authn_core mod_authn_dbd mod_authn_dbm mod_authn_file mod_authn_socache mod_authnz_fcgi mod_authz_core mod_authz_dbd mod_authz_dbm mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_dav_lock mod_dbd mod_dir mod_env mod_headers mod_include mod_info mod_isapi mod_logio mod_log_config mod_log_debug mod_log_forensic mod_cache_disk mod_mime mod_negotiation mod_proxy mod_proxy_ajp mod_rewrite mod_session_dbd mod_setenvif mod_socache_dbm mod_socache_shmcb mod_ssl mod_status mod_php5 

Nothing shows up in the error log when I try to start things with these configs, displayed in the system output is the following generic message:

5:38:11 PM  [Apache]    Checking default ports...
5:38:11 PM  [Apache]    Attempting to start Apache app...
5:38:11 PM  [Apache]    Executing "e:\xampp5.6\apache\bin\httpd.exe"
5:38:11 PM  [Apache]    Return code: 0
5:38:12 PM  [Apache]    Status change detected: running
5:38:12 PM  [Apache]    Status change detected: stopped
5:38:12 PM  [Apache]    Error: Apache shutdown unexpectedly.
5:38:12 PM  [Apache]    This may be due to a blocked port, missing dependencies, 
5:38:12 PM  [Apache]    improper privileges, a crash, or a shutdown by another method.
5:38:12 PM  [Apache]    Press the Logs button to view error logs and check
5:38:12 PM  [Apache]    the Windows Event Viewer for more clues
5:38:12 PM  [Apache]    If you need more help, copy and post this
5:38:12 PM  [Apache]    entire log window on the forums
SomeoneElse
  • 486
  • 1
  • 6
  • 22
  • _"gives a HTTP500 error"_ - When you get that error, check the servers error log to find what the actual error message is. You can also turn `display_errors` on in your php.ini (it's nice to have in your dev-environment). Without knowing the real error message, you're simply just guessing. Read more here: [How do I get PHP errors to display?](http://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display) – M. Eriksson Dec 23 '17 at 19:05
  • It isn't a php issue, it's a httpd issue. (I have every possible error display I know turned on): Apache: `ErrorLog "logs/error.log" LogLevel debug` php: `error_reporting = E_ALL & ~E_NOTICE display_errors = On display_startup_errors = On log_errors = On log_errors_max_len = 1024 ignore_repeated_errors = Off ignore_repeated_source = Off report_memleaks = On track_errors = On html_errors = On error_log = E:\xampp5.6\apache\logs\php_errors.log` – SomeoneElse Dec 24 '17 at 22:25

0 Answers0