Enable Apache mod_rewrite (server encountered an internal error or misconfiguration)
internal Server ErrorThe server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator, y...@example.com and inform
them of the time the error occurred, and anything you might have done
that may have caused the error.
log.
if you are experiencing this error when you place a .htaccess file in your directory with the code
' RewriteEngine on'
Then most probably 'mode_rewrite' on your Apache server is not enabled. To enable it do the following:
you can ignore step 3 if you don't find the information in the file.
- Find the httpd.conf file (usually you will find it in a folder called conf, config or something along those lines)
- Inside the httpd.conf file uncomment the line LoadModule rewrite_module modules/mod_rewrite.so (remove the pound '#' sign from in front of the line)
- Also find the line ClearModuleList is uncommented then find and make sure that the line AddModule mod_rewrite.c is not commented out.
- Now restart your Apache server.
Now everything should be ok.
source : http://groups.google.com/group/apachehtaccess/browse_thread/thread/9cedacdbe602272c
Labels: Apache, mod_rewrite
Enable LDAP in PHP on Windows (Call to undefined function: ldap_connect())
Enable LDAP in PHP on Windows (Call to undefined function: ldap_connect())
I am new to LDAP concept. As any beginner might find, I was confronted by the error ‘Call to undefined function: ldap_connect()’ when I tried to run the basic php code below:
<?php
echo "<h3>LDAP Connection test</h3>";
echo "Connecting ...<br />";
$ds=ldap_connect("ldap://yourldapserver"); // must be a valid LDAP server!
echo "connect result is " . $ds . "<br />";
?>
Soon I learned that LDAP support for php need to be manually enabled. Below are the steps I have done to enable LDAP in PHP on windows XP (appserv)
- Check your php information if you are not sure of it. Access ‘http://yourserver/phpinfo.php’ (in my case) and check for the following:
- Configuration File (php.ini) Path (C:\WINDOWS\php.ini)
- extension_dir (C:\AppServ\php5\ext)
- Open php.ini and find the line 'extension=php_ldap.dll' and take out the semi-colon if it is there.
- Open that folder ‘extension_dir’ and ensure the php_ldap.dll is there.
- If it isn't then put it in there. If that still hasn't fixed it you are missing a supporting dll, but you don't get told that. To see what dlls are missing open the Command Prompt and navigate to the php directory and execute the following line 'php -m'. You should get some error messages now. Ugly, but at least they give you information! Find the dlls listed and copy them to the php directory. You may now need to restart the apache/httpd service. Run 'php -m' again and you should be error free. (I didn’t have to do this part)
- If the above steps didn’t solve your problem then now you need to
On Windows NT, 2000, XP and 2003:
- Go to Control Panel and open the System icon (Start -> Settings -> Control Panel -> System, or just Start -> Control Panel -> System for Windows XP/2003)
- Go to the Advanced tab
- Click on the 'Environment Variables' button
- Look into the 'System Variables' pane
- Find the Path entry (you may need to scroll to find it)
- Double click on the Path entry
- Enter your PHP directory at the end, including ';' before (e.g. ; C:\AppServ\php5)
- Press OK and restart your computer
On Windows 98/Me you need to edit the autoexec.bat file:
- Open the Notepad (Start -> Run and enter notepad)
- Open the C:\autoexec.bat file
- Locate the line with PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;..... and add: ; C:\AppServ\php5 to the end of the line
- Save the file and restart your computer
Note: Be sure to reboot after following the steps above to ensure that the PATH changes are applied.
The PHP manual used to promote the copying of files into the Windows system directory, this is because this directory (C:\Windows, C:\WINNT, etc.) is by default in the systems PATH. Copying files into the Windows system directory has long since been deprecated and may cause problems.
Sources:
http://docs.moodle.org/en/LDAP_authentication#Warning:_The_PHP_LDAP_module_does_not_seem_to_be_present._Please_ensure_it_is_installed_and_enabled.
http://docs.moodle.org/en/LDAP_authentication#Warning:_The_PHP_LDAP_module_does_not_seem_to_be_present._Please_ensure_it_is_installed_and_enabled.
http://th2.php.net/manual/en/faq.installation.php#faq.installation.addtopath
http://forums.devshed.com/php-development-5/fatal-error-call-to-undefined-function-ldap-connect-260273.html
Labels: appserv, code, computer, ldap, php, server, software, windows