Koken – API Error. The theme is not able to make contact with your Koken installation.

I ran Koken as a photo gallery for my personal website under a Godaddy hosting.  Worked well.  But at some point I decided I needed my own “external” server for troubleshooting purposes, to help with my day-to-day System Admin job. Something outside of our corporate network so I can see if things are accessible from the outside. So I got myself a VPS from 1and1, running Windows 2008 R2.  With that I figured I move this blog, my business webpage, as well as my personal webpage to the VPS.  I’m running the webpages on IIS.

So I recreated my personal webpage and reinstalled the Koken. The install to Koken went swimmingly. No problem connecting to the database. The admin page launches with no issues.  However, when I try to visit the page, I get the dreaded “API Error. The theme is not able to make contact with your Koken installation. Contact your host to see if they are blocking loopback connections.”

Now I’m not a coding expert so I’m not sure where to look. But I started from scratch and checked the Koken requirements.  I did notice that I did not have the iMagick module so I got that to work first by following the entry by FDIM here.  After that, the iMagick module showed up under phpinfo(). But that did not help my API Error.

After alot of trial an error, I hit upon this post within Koken’s help itself.  There, the user Pascal talks about what is going on with the backend requests and it gave me the idea to simply modify the whole ” curl_setopt($curl, CURLOPT_URL, self::$protocol . ‘://’ . $host . self::$location[‘real_root_folder’] . ‘/api.php?’ . $url);”  section in koken.php. Rather than have the function try to determine where the api.php is, I hardcoded it:

curl_setopt($curl, CURLOPT_URL, ‘http://www.domain-name.com/koken/api.php?’ . $url);

Where www.domain-name.com is replaced with your own domain name. This assumes you have Koken installed in a koken subfolder off of root and the api.php is located there. (The koken.php is located in the koken\app\site\ folder – make a copy of the file before you begin editing, just in case).

Save that modified file and bingo! That’s it!  No more API Error.

I was racking my brain for two days on this.  Hopefully it will save someone else some time and trouble.

Increase the Max_Input_Vars in PHP For IIS WordPress Install

Installed WordPress for a client, they wanted a particular theme. The theme has some sort of Server Health page which showed the Max_Input_Vars was set to 1000 and it was recommending to go higher. I searched hi and lo for  how to change it. All the websites I hit said add a php.ini with the settings you want or update the .htaccess file.  Neither worked.  But what did work was this (if you’re running wordpress on IIS):

  • Open up Internet Information Services (IIS) Manager
  • Select the server name in the left side Connections pane
  • In the Features View, select PHP Manager

  • Click on Manage all settings

  • In the Filter box type max_input_vars and hit Go

  • Right-click the max_input_vars and select Edit
  • Change the value to whatever you want (I set it to 3000), then hit OK.

That’s it!  You can verify by creating a test.php file with the following line:

<?php phpinfo(); ?>

Open up that test.php page in a browser. There, search for the max_input_vars and it should show you the updated value.

Ridiculous – #AAPL, #VZ Fight Against New York’s ‘Right To Repair’ Law | Techdirt

Update 6/1/17: Well score one for the little guy! Supreme Court rules in favor of Impression Products who sold refurbished Lexmark Ink.

This is ridiculous. Again, mega companies trying to push out the small mom and pop fixit shops. I should be able to buy parts and fix my iPad or iPhone or my Android phone just like I open up my computer to swap out a power supply, memory, or hard drive when they fail. I bought a repair kit to fix my wife’s cracked iPhone 5s. Phone was already paid for completely and well past the warranty date. Apple saying I wasn’t allowed to fix it myself for $35? Granted, if the thing is under warranty and I open it up it should void the warranty. But I should be able to get it fixed without having to shell out $100. Plus if I’m technically inclined, which I sometimes am, I should be allowed to do it myself.

Source: Apple, Verizon Join Forces To Lobby Against New York’s ‘Right To Repair’ Law | Techdirt

Send Emails At Regular Intervals

I’m a network admin, and as such, maintain an Exchange server with a Barracuda spam filter. I needed something that could send an email to myself, from the outside, so that I can be sure my server is accepting emails and the spam filter is passing them through, and eventually get it on my iPhone. Almost like a path test. Of course, I could just send myself an email from time to time from my yahoo or gmail account, but I wanted something automated, that would send at regular intervals.  Before I get the dreaded call from a user saying “Hey, I haven’t gotten any emails from the outside world in a few hours! What gives?”. So I wrote this little VB app. It doesn’t save passwords, so you have to enter it every time you start it up. It’s pretty self explanatory. AND it’s a work in progress.  You can hit the ‘Load Config’ button to load a generic config to start you off. If you’re sending from Gmail and you use Two-Factor Authentication, be sure to create an app password and use that.

Head to the Downloads page if you want to try it out.  Feel free to post comments, suggestions, bugs, etc, back here.

Email Attachments Coming In As .Bin Files


Had a user who was sending attachments (in this case they were MS Word documents with a .doc extension) through Outlook 2010. Some (not all) external recipients who were on Outlook Office 365 were receiving the attachments as .BIN files:bin


On the Exchange server, for Remote Domains, tell it never to use RTF:


Convert Unix [Epoch] time to human readible form

Ran into a situation where I needed to read logs that had Unix time stamps. So I needed something that converted the time stamps to standard date/time format. I wrote up a small VB widget to do the job. Hopefully it can be useful for others. It’s a work in progress : )

You enter in the Unix time, hit the Convert button, and it gives you the Human Date/Time. Head over to the Downloads page if you want to try it out…

Batch Copy Logs From Server At Multiple Intervals Using Task Scheduler

I came across a situation where a vendor wanted logs files from a server at around 2am in the morning to troubleshoot why an application wasn’t sending a specific email at that time. Problem was, I wasn’t planning on being up at that early in the morning to grab log files and I didn’t know exactly what time it was supposed to send it. The time was usually around 1:30am but sometimes, when it worked, I’ve seen it sent at 4:30am.

So the plan was to come up with a simple batch file to handle the copying of the logs at every hour between 11PM and 5AM to my local Win 7 desktop,

This required a few things:

  1. A batch file that would a) make a directory based on the current time b) copy the files into that directory
  2. A task to run the batch file, triggered at every hour between 11pm and 5am.
  3. Access to the server where the logs are kept


Batch File

My batch file consisted of  the following:

@echo off
SET datestmp=%date:~-4,4%%date:~-10,2%%date:~-7,2%
SET HOUR= %time:~-11,2%
SET timestmp=%HOUR%_%time:~-8,2%
MKDIR logs\servername\%datestmp%_%timestmp%
@echo on
COPY \\servername\logs\email.log  logs\servername\%datestmp%_%timestmp%\ @echo off


The above batch file first gets the date and time, formats it, and creates a directory with the date/time as part of the directory name. So if the date and time was 6/09/15 and the time was 2am, the directory would be called “20150609_2_00”

Then it takes the email.log file from the \\servername\logs\ folder and copies it to a local folder on my machine called logs\servername\20150609_2_00\, which would be relative to where the batch file is run from.

I named the above batch file copylogs.bat and saved it on my local desktop under the C:\temp folder.

I ran the batch file to make sure it works and instead it failed! The reason being, the batch file ran under my desktop login account. I have a separate admin login for the server. So I mapped to the server using my admin login first. With that connection being made, I reran the batch file, and sure enough, it worked.

Next up was creating the tasks to run the batch at certain intervals…

Task Scheduler

1. Start by Creating a Basic Task:

basic task

2. Give the task a name:

task name

3. Set your trigger. In my case I’m setting to “One time” and will give it a specific time to start (probably about 20 minutes into the future so that I can test to see if it will run properly). Later, I will schedule it to run at particular times throughout the night.


4. Set your action. In My case I’m starting a program (my batch file):


5. Here’s where things start to get tricky.

Since it’s a batch file, the Program/script I’m running is cmd (command prompt). The Additional arguments will be:

/k start “” “c:\temp\copylogs.bat”

And it’s starting in c:\temp (no quotes).


6. After saving the task, one last thing I had to do was go back, edit it, and Change User or Group, so that it ran under my server admin account, and Run whether I was logged in or not, saving my password.


After I finished, and tested it successfully, I went back and edited the task, adding more Triggers:

more triggers

That’s it! Hopefully someone else will find this useful.



Internet Explorer 8 Crashes on Manage Add-Ons

Problem: In IE8, when you click to Tools –> Manage Add-Ons, Internet Explorer crashes with a Data Execution Prevention error.

Symptoms: Application Event Logs show Event ID 1000 – Faulting Application iexplore.exe

I tried reinstalling IE8, but that did not help

Solution: For me, the problem was due to a faulty ActiveX control or Java applet. Go to C:\WINDOWS\Downloaded Program Files and check the status of the controls There, I found one add-on that had a status of “Damaged”. Some were also “Unknown”. Others were “Installed”. You can right-click on the add-on and select “Remove”. I actually removed them all, then reinstalled my Java.

Internet Explorer 8 – Does Not Remember Password

Problem: Internet Explorer 8 won’t remember the user’s password information for a website


User starts IE8, types in “salesforce” in the address bar, which automatically brings him to to Salesforce.com. He clicks on the Login link, enters his Username and Password, checks off the box that says “Remember User Name”, and goes about his work. Afterwards, he closes out IE8 and then reopens it later on. He proceeds to Salesforce.com again, but it takes him to the login page and prompts for the password (User Name field is already populated). It should remember his password and log him in automatically.


I added salesforce.com to the list of websites to be always allowed to use cookies (in the Per Site Privacy Actions in the Privacy tab of Internet Options). The change did not work. Next, I tried deleting all browsing history and made sure the “Preserve Favorites website data” was checked off (Press the Delete button under Internet Options –> General Tab –> Browsing history) and the “Delete browsing history on exit” option was NOT checked off . This too, did not work.

What did work was deleting all the salesforce.com bookmarks from the user’s Favorites!

Simply Security – EU proposes data protection overhaul; criticism ensues

The European Commission this week revealed a proposed overhaul to decades-old data protection rules in an effort to improve online privacy and Internet security across the European Union (EU) and beyond. However, even before the effects of the proposed rules could settle, backlash was felt from companies and governments around the world.

But here’s the real kicker…

The U.S. government was also quick to respond to the commission’s proposal. According to news provider the AFP, U.S. Coordinator for International Communications and Information Philip Verveer told reporters that the United States would examine the legislation closely in order to determine whether the proposal would be too costly for American businesses.

Sooo…as usual, the government would rather protect business interests rather than the public’s interest.  It should be mandatory, that any business that retains any consumer’s Personally Identifiable Information, should have that info encrypted.

Read more…EU proposes data protection overhaul; criticism ensues | Simply Security.