YouMayLikeIt Good food for less money with a plan

Fixing Dokuwiki after htaccess nice URLs fails

Posted on January 27, 2011

There may be issues with your server that keep Dokuwiki’s version of htaccess-based nice URL’s from working. However, once you enable them, not only will regular dokuwiki pages fail, but the configuration page will fail as well. Here’s how to fix this.

  1. In the sub-folder  “conf” in your Dokuwiki directory, find the files dokuwiki.php and local.php.
  2. Locate the line $conf['userewrite']  =… in each file.
  3. Change it to $conf['userewrite']  = 0;  in dokuwiki.php and $conf['userewrite'] = ’0′; in local.php (notice the quotes).
  4. Save the files.

That should fix the issue and you’ll be able to access your admin panel again.

Filed under: Blog posts No Comments

‘google.maps.MapTypeId.ROADMAP’ is null or not an object

Posted on January 22, 2011

If you tried to integrate Google Maps onto your page and you get this error:

‘google.maps.MapTypeId.ROADMAP’ is null or not an object

I might know what the problem is. In version 2 of the Google Maps API, you had to get a site key. Version 3, however, does not require that, and if you’re using the latest version 3 code but you’re trying to load the  version 2 API with the key, then you may run into trouble. The solution is simple. Just replace your script loading code with the following.

<script type=”text/javascript” src=”http://maps.google.com/maps/api/js?sensor=false”></script>

(Or, if you use a sensor, set sensor=true.)

Filed under: Blog posts No Comments

WAMP, cURL, and SSL (https://)

Posted on January 20, 2011

One of my development test environments is a WAMP server (WAMP is Windows Apache MySQL PHP).  I know some people are already getting angry that I use Windows, but the fact is that end users primarily use Windows, so once should test on platforms that the end user uses. So, that being said, I have a laptop running Windows that I develop on, and I have WAMP running there so I can test changes locally. However, I was having trouble getting cURL to connect via SSL. It was running fine on my live server running LAMP, but it wouldn’t work at all with WAMP.

First, if you’re reading this, make sure that cURL is enabled. If cURL is not enabled, then cURL with SSL will never work! To do this, click the WAMP tray icon, select the PHP menu, then the PHP extensions sub-menu, and then make sure php_curl is checked. If it wasn’t checked, then check it and restart the server.

So, once you have cURL working, here’s how to get SSL working. The critical piece of code is curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);, where $ch is the variable that holds your curl session.

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $my_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($ch);

Filed under: Blog posts No Comments

YouTube embedding and W3C validator

Posted on January 19, 2011

If you’ve ever tried embedding a YouTube video on your site and then running the W3C Validator, you’ve probably run into errors. Here are the errors I hit:

  • cannot generate system identifier for general entity “fs”
  • general entity “fs” not defined and no default entity
  • reference not terminated by REFC delimiter
  • reference to external entity in attribute value
  • reference to entity “fs” for which no system identifier could be generated
  • entity was defined here
  • there is no attribute “src”
  • reference not terminated by REFC delimiter
  • reference to external entity in attribute value
  • reference to entity “fs” for which no system identifier could be generated
  • entity was defined here
  • there is no attribute “type”
  • there is no attribute “allowscriptaccess”
  • there is no attribute “allowfullscreen”
  • there is no attribute “width”
  • there is no attribute “height”
  • element “embed” undefined

Yikes, what a list of errors. While it is a bit of a badge of honor to put the W3C logo on your site saying that it’s up-to-snuff according to whatever standards are out there, there is basically no way around it with YouTube’s embedding. You could try some tricks like putting in an iframe that would load a separate page that only contains the YouTube video (and thus embed an “invalid” page in your “valid” page), but that’s just smoke and mirrors more than anything else.

If it is any comfort, YouTube.com isn’t close to being W3C compliant, as you can see in the link. As of this writing, it has 140 errors and 2 warnings. So, your time might be a bit better spent correcting the actual errors or poor standards that you use rather than trying to figure out how to embed YouTube video error-free. (I know that isn’t a satisfactory answer!)

(Another trick that might work is setting up a div tag, and then loading an external javascript file that changes the innerhtml of the div tag to the YouTube embedding code after load. That would trick the W3C validator into think you have valid code, and you’d still get the YouTube functionality. But, as of this point, I know of know way to actually make YouTube embedding W3C approved.)

Filed under: Blog posts No Comments
   
 © 2017 Nabadab, LLC