IT Comrade

""

Enable Apache mod_rewrite (server encountered an internal error or misconfiguration)

Edit Post

internal Server Error

The 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.

More information about this error may be available in the server 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.
  1. Find the httpd.conf file (usually you will find it in a folder called conf, config or something along those lines)
  2. 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)
  3. Also find the line ClearModuleList is uncommented then find and make sure that the line AddModule mod_rewrite.c is not commented out.
  4. Now restart your Apache server.

Now everything should be ok.
source : http://groups.google.com/group/apachehtaccess/browse_thread/thread/9cedacdbe602272c

Labels: ,

Posted by Alogger on Tuesday, June 26, 2007 at 2:11 AM. 0 Comments

Enable LDAP in PHP on Windows (Call to undefined function: ldap_connect())

Edit Post

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)



  1. Check your php information if you are not sure of it. Access ‘http://yourserver/phpinfo.php’ (in my case) and check for the following:


    1. Configuration File (php.ini) Path  (C:\WINDOWS\php.ini)

    2. extension_dir    (C:\AppServ\php5\ext)


  2. Open php.ini and find the line 'extension=php_ldap.dll' and take out the semi-colon if it is there.

  3. Open that folder ‘extension_dir’ and ensure the php_ldap.dll is there.

  4. 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)

  5. If the above steps didn’t solve your problem then now you need to


On Windows NT, 2000, XP and 2003:



On Windows 98/Me you need to edit the autoexec.bat file:



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: , , , , , , ,

Posted by Alogger on Wednesday, June 20, 2007 at 7:22 PM. 1 Comments