PHP

How to Install, configure and run PHP on Windows IIS and other platforms.
Coding and debugging with PHP.

XML Parsing Error in Firefox; Cannot Display This Feed in IE

2017/11/19
By
Modified: 2017/11/05
Firefox-XML-Parsing-Error

This article describes, how to fix RSS Feed error messages in WordPress. In Firefox the error is “XML Parsing Error”.  In IE you see “Internet Explorer cannot display this feed”.   Symptoms When you click on RRS link in WordPress (or bbPress), you are getting this error message (see images bellow).  The message is different depending on your browser. Firefox Internet Explorer XML Parsing Error: XML or text declaration not at start of entity  Location: http://www.domainwebcenter.com/wp-content/bbpress/rss.php?topic=29 Line Number 4, Column 1:<?xml version=”1.0″ encoding=”UTF-8″?>   Internet Explorer cannot display this feed  This feed contains code errors. Go back to the previous page. More information Invalid xml declaration. Line: 4 Character: 3 <?xml…

Read more »


Block Remote Comments on a WordPress site

2017/11/12
By
Modified: 2017/11/05
Ban Remote Comments on a WordPress site

How to block remote comments on a WordPress site?   How indeed?   Here is a question for all of you – WordPress masters out there.   Right now I am a bit puzzled. Problem – Comments without Visits I am noticing that people are posting a spam comments in a very tricky way.  Somehow comments arrive with Site URL field populated, but I do not even have that field on the “Leave a Comment” form. It means that there is an automated way to send a comment without actually visiting the site.  Is it true?  I am searching all over the Internet right now. Looks like there is a product out there called CxxGxx. …

Read more »

How to limit a WordPress plugin to just one page?

2017/10/22
By
Modified: 2017/09/16
How to limit a WordPress plugin to just one page?

How to limit a plugin to just one page, or a few pages?  How to load a plugin only where you need it? I encountered a problem, where plugin Contact Form 7, if activated, would slow down entire WordPress site to a crawl.  Contact Form 7 is great, and I want to continue to use it.  However, this one plugin makes every page load to the count of 13 or 14.  Without it, every page loads to the count of 2 or 3.  What can I do? The solution turns out to be a very simple one.  Simply disable entire plugin unless you are loading certain pages that require this plugin.…

Read more »

How to Install WordPress 4.X on Windows 10 and IIS 7.5

2017/10/20
By
Modified: 2017/09/16
Pick-IIS-FastCGI-Option

This article is written for those who need to test/evaluate features of new WordPress release on a local machine before rolling it out to all the serves. This article describes running PHP on IIS 7.5 through FastCGI. For best results, reader is required to be able to start and stop services, understand registry manipulations, be comfortable with copy and paste inside a command prompt (Alt+Space, E, P). To achieve better portability, try to match your test machine directory structure as close as possible with your server. Other IIS Features to Pick If you are planning to test old ASP sites on the same machine, you also need to pick: - ASP…

Read more »

Add User Register Date Column in WordPress 3.X and 4.X

2017/10/04
By
Modified: 2017/09/16
WP-Users-with-Date-Column

This solution was last tested on WordPress 4.1.1 in March 2015.   This solution was tested on WordPress 3.1 running on IIS7 and IIS 7.5.  It will work on WordPress 3.1.1, on 3.2.1, and on 3.5.1.    This solution was just tested on WordPress 3.8.1 and works very well. This solution adds a new column to your admin user page, and makes it sortable (optional).   Here are the steps. -01- Find wp-admin\includes\class-wp-users-list-table.php and make a backup copy of the file. Call it class-wp-users-list-tableORIG.php.   -02- Open wp-admin\includes\class-wp-users-list-table.php in your favorite editor.   -03- Find line function get_columns() {   -04- Add a new line of code ‘user_registered’ => __(‘Date’), after…

Read more »

PHP chokes server with TEMP files – Updated and Solved

2017/08/11
By
Modified: 2017/07/22
FastCGI Settings

I am running PHP on IIS 7.5.   This is a Windows 2012 Server.  Fresh clean install every time. The only way to access and delete these TEMP files are by using  a command prompt.  And this deletion procedure will run for several DAYS . . .   The Problem The story goes like this.  Fresh new instance of a Windows 2012 Server is great.  It runs fast and smooth.  But after 5 or 6 months MySQL service having hard times to start up.  And a little later – couldn’t start at all.  The only way I can make it run is to start it from a command prompt.  And finally the whole server just slows…

Read more »

ERROR: Unreadable CAPTCHA cookie – RESOLVED!

2017/08/07
By
Modified: 2017/06/25
WordPress -  Unreadable CAPTCHA cookie

RESOLVED!  One of the test WordPress instances had an impossible, unpleasant and not covered on Google error message.  When user is trying to register, the CAPTCHA code is displayed properly and validation is correct, but when the button Register is press, the page would display this: ERROR: Unreadable CAPTCHA cookie I have a plugin “SI CAPTCHA Anti-Spam” installed.  The error message is from this plugin. I’ve tried changing browsers, clear cache and cookies. Nothing worked.  No luck on Internet search either.  What to do? Finally I changed one of the settings on the plugin itself.  I check an option for: Use CAPTCHA without PHP session And it worked!  The error message…

Read more »

Can I debug PHP site on IIS? – Yes

2017/08/03
By
Modified: 2017/06/25
Xdebug-PHP-Info

If you have WordPress or any other PHP site hosted on IIS you can debug it for free.  No Apache server is required. You can use NetBeans with Xdebug. This article records all the steps required to debug a PHP site on IIS.  It seems that actual WEB server used is irrelevant.  However, all steps here were tested on Windows 7 SP1 with IIS 7.5. (01) Download JAVA and IDE (Integrated Develop / Design Environment)  This is analogous to MS Visual Studio (VS).  Oracle offers a combo pack – JAVA SDK + NetBeans.  You need both.  Search for “JDK 6 Update 24 with NetBeans 6.9.1″. http://www.oracle.com/technetwork/java/javase/downloads/jdk-netbeans-jsp-142931.html   (02) From Xdebug download…

Read more »

Set up bbPress as WP Plugin: Convert from bbPress standalone

2017/07/04
By
Modified: 2017/06/25

We went live with new bbPress plugin on January 28, 2013.   bbPress as a plugin for WordPress I started preparing for series of upgrades to the latest WP version (3.5), and Theme and all the plugings.  It was immediately obvious that among other things, I would have to look into migrating from integrated bbPress to a bbPress as a WP plugin. So far my experience was pretty intense.  I will try to log my progress here as I am moving forward preparing a production roll-out on my test site. Migrate your bbPress data from “bb_” tables into your “wp_” database I was able to migrate all the content from old…

Read more »

Control WordPress 3.X.X Admin Bar Options for Subscribers

2017/06/01
By
Modified: 2017/04/30
WP-331-Admin-Bar-Removed

WordPress admin bar contains many interesting and convenient links for admins and editors. But it is totally useless, redundant and confusing for regular users. Here is how to hide it for subscribers while viewing the site. Open your theme functions.php file and add these  lines at the very end: if(current_user_can('subscriber')) add_filter( 'show_admin_bar', '__return_false' );   To hide Admin bar while users are in Control Panel, you need to add these lines at the end of your theme style.css file: #wpadminbar { display: none; visibility: hidden; }     The final questions to answer: -01- Can we do all these changes one file and -02- How to remove an ugly empty space at the top of…

Read more »

Integrating bbPress Forum with WordPress Theme

2017/05/13
By
Modified: 2017/04/30
WordPress-plus-bbPress

Problem When I was preparing to roll out bbPress forum as a part of  WordPress site,  I discovered that process of bbPress user and login integration has a very good coverage on the Internet. This article deals with integrating bbPress forum “look and feel” with WordPress. How to make bbPress forum look like your  regular WordPress page?  How to create a deep integration,  so users wouldn’t feel that they are leaving one site and now are in a completely different site. You can judge, how well this advice works based on how close our Forum interface integrated with WordPress theme. One should be able to tell the difference between bbPress styles and WordPress…

Read more »