A friend of mine had an issue with a vanilla wordpress install that he had that was using a premium theme.
Upon loading the theme, the page showed many errors relating to servers security setting would not allow the loading of data from external urls.
The information we were given was to set the php.ini in the directory of the calling page, so that the setting could be overridden - so we did, no change.
The solution is that the php.ini file in the wp-admin folder needs setting, not in the calling page, because the calling page in this case is a settings page itself that is being imported into the wp-admin/index.php file.
The settings in php.ini are then:
allow_url_fopen = 1
allow_url_include = 1
Tuesday, 22 November 2011
Wednesday, 4 May 2011
PHP .htaccess redirect
I have been helping a neighbour of mine who is an Optician in Spalding, and he was trying to make sure that when people were searching for "Opticians in Spalding" they would make sure that the old pages on his website that were already listed in Google, would still link through to his new site that he's spent ages on.
Being a windows server man, I know how to do this in IIS, but as his new website is hosted on a linux server, it needed to be compatible with that. So anyway, I found out that you can do 301 redirects on Apache using a .htaccess file.
In this case, it was real simple, create a blank file called .htaccess and the place an entry for each for each file that needs redirecting, i.e:
Redirect 301 /HTML/Consultations.htm http://www.molsom.co.uk/eye-tests.htm
Excellent, and I now know that visitors to my local Optician in Spalding will still get there from any old bookmarks!
Tuesday, 1 March 2011
EventType clr20r3 system.io.filenotfoundexception
I had this error today when trying to launch a .net application on a remote host machine. The file io exception threw me somewhat as it made me think that the issue was with loading a config file.
In fact the culprit of this error was not the config files, it was in fact missing dlls that are normally referenced from the GAC.
As I had no idea which dll it didn't know about, I just set each dlls reference to say copy to local = true, and then deployed the whole contents.
In fact the culprit of this error was not the config files, it was in fact missing dlls that are normally referenced from the GAC.
As I had no idea which dll it didn't know about, I just set each dlls reference to say copy to local = true, and then deployed the whole contents.
Wednesday, 22 December 2010
List.Sort() alphabetically
I was faced with the challenge today of sorting a list of objects, where one of the properties was a string. My objects were lists of keywords, and I wanted to sort the keywords alphabetically.
I came across some example of lambda expressions, and found that rather than having to write complicated sort methods for my class, I could just do the following:
Awesome, works a treat!
I came across some example of lambda expressions, and found that rather than having to write complicated sort methods for my class, I could just do the following:
keywords.Sort((a,b) => String.Compare(a.keyword, b.keyword)):
Awesome, works a treat!
Wednesday, 24 November 2010
SQL Server could not spawn FRunCM thread. Check the SQL Server error log and the Windows event logs for information about possible related problems.
I encountered this error this morning when my SQL Server instance wouldn't start after I made some connection changes yesterday. I had to make the changes because a needed an ODBC connection, and that would only seem to work if I configured it to use named pipes.
After checking the logs, I received the error "SQL Server could not spawn FRunCM thread. Check the SQL Server error log and the Windows event logs for information about possible related problems.".
So, I went back to undo each change I had made, and noticed that the last change I made was to enable VIA as a protocol for my SQL Server instance. Disabled that, and hey presto, SQL Server now starts fine.
The strange thing is that enabling VIA in my SQL Express instance didn't seem to cause the same issue on that server though.
After checking the logs, I received the error "SQL Server could not spawn FRunCM thread. Check the SQL Server error log and the Windows event logs for information about possible related problems.".
So, I went back to undo each change I had made, and noticed that the last change I made was to enable VIA as a protocol for my SQL Server instance. Disabled that, and hey presto, SQL Server now starts fine.
The strange thing is that enabling VIA in my SQL Express instance didn't seem to cause the same issue on that server though.
Tuesday, 27 April 2010
asp.net checkbox modalpopupextender checkbox doesn't check or uncheck
There is an apparent bug in asp.net that when you have a checkbox inside a panel that is acting as a modal popup with the modalpopupextender, that when you try to check or uncheck it, it doesn't work!
I found the following thread, and it seems that quite a few people have had this very same problem.
From reading many posts, it seems that this happens if you do not set the TargetControlID property of the extender correctly.
However, this becomes an issue if you have multiple links, all that show the same extender. To get round this, you can simply create a fake button:
And then in your modal extender, set TargetControlID="btnFakeButton". With your links / buttons to active this, simply in the code behind for the event for each link / button, do mdlExample.Show() to display the modal.
I found the following thread, and it seems that quite a few people have had this very same problem.
From reading many posts, it seems that this happens if you do not set the TargetControlID property of the extender correctly.
However, this becomes an issue if you have multiple links, all that show the same extender. To get round this, you can simply create a fake button:
And then in your modal extender, set TargetControlID="btnFakeButton". With your links / buttons to active this, simply in the code behind for the event for each link / button, do mdlExample.Show() to display the modal.
asp.net button not posting back
I have a modalpopup extender attached to a panel, inside which resides two asp.net buttons. Each of these had the normal "Onclick" attribute assigned to them. However, when they were clicked, no postback was occuring.
From some reading around, it appears that this is by design, and that the buttons are there for this to be closed.
So how do you get round this?
You can attach a javscript client side event that mimmicks the behaviour of what happens with asp anyway, by forcing the postback to take place.
Firstly, in the head of your page, define a function that ensures that the page is valid first, and then causes the postback to take place (the validation part is crucial for this to work.
function doPostback(sender,e)
{
if(Page_IsValid)
{
__doPostback(sender,e);
}
else
{
return false;
}
}
Now in your code behind, tell your buttons to call this:
btnSaveUserDetails.OnClientClick = "javascript:return doPostback('" + btnSaveUserDetails.UniqueID + "');";
It is important here that the uniqueID is used, as this ensures that any controls that are nested pass the right details to the postback function.
And ta da, they now work!
From some reading around, it appears that this is by design, and that the buttons are there for this to be closed.
So how do you get round this?
You can attach a javscript client side event that mimmicks the behaviour of what happens with asp anyway, by forcing the postback to take place.
Firstly, in the head of your page, define a function that ensures that the page is valid first, and then causes the postback to take place (the validation part is crucial for this to work.
function doPostback(sender,e)
{
if(Page_IsValid)
{
__doPostback(sender,e);
}
else
{
return false;
}
}
Now in your code behind, tell your buttons to call this:
btnSaveUserDetails.OnClientClick = "javascript:return doPostback('" + btnSaveUserDetails.UniqueID + "');";
It is important here that the uniqueID is used, as this ensures that any controls that are nested pass the right details to the postback function.
And ta da, they now work!
Subscribe to:
Posts (Atom)