Monday, August 24, 2015

Website Themes: Big Promises-Big Problems

I’m struggling to understand why “Content Management Systems” such as WordPress, Drupal, and Joomla rely so much on themes and templates for the visual appearance of a website. I use Content Management Systems for “content management”, not web design. Who asked them to take over control of visual design ? All I want from a content management system is to handle forms, and provide website “functionality” such as blogging, storing categorized content in a database, user account management, etc. I don’t need, or want them to create the look of my website. Why does the visual appearance of my website have to depend on themes written with PHP programming? Honestly, I feel like it’s some scheme to take power away from the website’s creator, and make more jobs for PHP developers and web designers.
I recently built a web design I like using nothing but HTML and CSS, but programs like WordPress, Drupal, and Joomla, to name a few, make little if any provisions, for a designer to import a web design as a simple HTML file. And why ? What else do you need to create the visual design of your website, other that HTML and CSS…have you seen what HTML 5 can do ? It even has it’s own media player now, which takes one line of HTML code to insert it into your webpage. And , it has a feature called “canvas” that will allow you to draw and paint on a website.
WordPress, Drupal, Joomla and the like, have thousands of available themes, both free and paid. Most are excellent visual designs, but not quite right for your site in some way or another. Naturally, you want to change the design somewhat, but you find that you have to know PHP. If these themes were written in HTML and CSS, these changes would be a simple matter.
The theme designers usually claim (falsely), that you’ll have complete control over the layout and colors of the theme, but in fact, the changes that you can make (without PHP) are very minimal, and insufficient. Some won’t even let you add your own logo, but instead, will only display your site’s name in a text font that matches the design of the template.
Another problem I have with these themes/templates is that not one of them I’ve ever seen, looks like it does in it’s advertising. They claim you have to add all of your content and menus first. I strongly disagree with this. My own web design has the same layout, the same sizes for the various content areas, etc., whether or not there is any content or menus.
While it is true that after you add a certain amount of content, most themes will begin to look the way they were advertised, that’s not what I want from a theme. I want to see it looks the way it’s supposed to look whether or not it has any content added.
I wouldn’t mind if the theme just appeared “empty”, with empty boxes and no text or images. I just don’t like it when the theme “collapses” with NO boxes, or have boxes drifting out of place, like a sidebar falling to the bottom of the screen when it’s supposed to be on the right (or left) side.
One theme I tried, actually listed my post’s in reverse date order and pushed my most recent posts to the bottom of the page, instead of pushing them to the top where they belong. I was stunned by this behavior because posting articles is handled by an entirely separate program. How could (or why should) the visual design part of the site interfere with  this ?

As for the theme shown in the image above, the right-side column drops to the bottom of the page.
You don’t need a full-fledged programming language to create and position some empty content boxes on a page, or create the pages color scheme. You only need a programming language to determine  what content goes in each content box, and when. For instance, you can use a programming language to change the content of any area on your website on a regular schedule, or set different schedules for each area of your website.
Using a programming language to create the visual design of your site is a waste, because the visual design isn’t going to change on a daily, or hourly, or minute-by-minute basis.
For those who may not know, HTML and CSS, the tools we use to create the visual design, are not programming languages, but “markup” languages. The difference being that markup languages cannot do things based on time, such as doing something on a schedule. Markup languages also cannot do things based on decision-making or choice, such as “if user clicks here, and it’s after 6:00PM, show this article (or picture), otherwise show a different article”. Here, the program has to make a decision (is it after 6:00PM) and then a choice (show this article or the other), based on that decision.
When you’re building a website, you don’t want to see this crap (bottom image), you want to see how the site is actually going to look, and you want to see this at all times,from beginning to end. Why can’t they just make it look like the preview image from the beginning. The very least they could have done is display fake (placeholder) menu titles and a few of the orange bullets until the actual menu is filled-in.
I think these Content Management Systems should stick to, uh… content management and leave the visual design to us.

Wednesday, July 15, 2015

Problems With Firefox Browser

I don't know what all the hoopla is about the Firefox browser in recent years.
I'm running two different version numbers of Firefox on two different operating systems
 (Windows 8.1 and Linux Mint 17.2) and Firefox won't display images on either one.
The images display just fine with the "Chrome", "Internet Explorer", and "Opera" browsers,
so I have to conclude that the fault must be with Firefox.
I have had other problems with Firefox as well, but I won't get into those here.
I went through the Firefox troubleshooting procedure for "images not being displayed", but the settings it instructed me to check weren't even there.
It could be malware,but the fact that it's only infected Firefox further erodes my 
opinion of Firefox as a browser.



Saturday, June 6, 2015

CSS Styles Not Displayed

As I mentioned in my previous post, titled "forums With Attitude" I am having a problem with CSS styles being displayed when the web page is served by Apache, but the pages display normally when they're simply opened from the desktop as html file under windows.
It's beginning to look like this is a malware problem. I just updated "Windows Defender", so I decided to go ahead and run the "quick scan". The scan uncovered a piece of browser malware (see image below).



Unfortunately, removing this did not solve my problem, so I started poking around with other things.
With "Firebug" a Firefox debugger ad-on, it showed that my stylesheet had been replaced with a stylesheet using made-up style rules that begin with the word "yuck". However, Windows defender either didn't find the cause of this, or the malware can defeat Windows Defender.
I suspect the latter because after Windows Defender supposedly removed the malware, I scanned parts of the system (windows) again using "Custom Scan" and I found that Windows Defender will not scan the "Users" or "Windows" folder.
So, no solution yet. Still working on it. But I just wanted to let you know that this problem may be caused by other means than those that the forum guru's stated.

Forums With "Attitude"

I've just gotta say something about these internet forums on LAMP / WAMP topics. I've never been a big user of forums, but recently, I've run into a few problems I didn't think I could solve on my own, but eventually did solve, after the solutions found on forums didn't work. Also, I've never actually had to post a question because I always found my problem to be well covered. So I personally haven't been insulted by these snobby people on the forums, but after reading through many of the forums, I became irritated  with the “attitude” of some of these “smart” people who's solutions don't seem to work. Which is a major part of why I started this blog. I figurured, why not just share my solutions without judgement or the smarty-pants remarks. After all, people don't go to forums to be scolded or be insulted by someones sarcasim, they're just looking for HELP !

I'll give you one example. I'm currently having a problem with web pages served by Apache 2.4.12 not rendering CSS styles. Now other people have posted the same problem to these forums, and for the most part, all they've gotten for an answer is : “Apache doesn't render CSS, the browser does”.
They say that Apache has nothing to do with this problem, but apparently it does, because when I save a webpage to the desktop as an “html” file and click on it, the browser opens up and displays the page with the CSS styles as it should, even though the CSS file is located in, and called from, the Apache webroot folder “htdocs”. But when I put the HTML file in “htdocs” and serve it from Apache, there are no CSS styles rendered in ANY browser ( IE,Chrome,Firefox).
These “smart” people seem to completely ignore that it might be an Apache configuration problem, which I saw with PHP, when Apache wouldn't serve PHP pages, but only the text of the PHP code itself. Hey “smart” people, Apache isn't the  interpreter for  PHP code either, but it has to be configured properly in order to serve PHP pages properly.
So I'm going to work on Apache configuration for this problem, and as always, I'll post the solution when I figure it out.
Meanwhile,to all you forum geeks: If you're so sensitive to the way a question is asked, or which topic it properly belongs under, or having your precious time wasted, as when you tell people “come back after you do this or that,  then stop wasting your time, and ours, on the forums. After all, the time wasting is a choice, you don't have to "waste" your time on the forums, because believe me, most of the time your “help” isn't that good.






 

Sunday, May 31, 2015

PHP Not Loading Extensions


Before you drive yourself nuts looking for a solution and getting confused by all the advice on forums, you need to understand that the problem may be with the PHP organization itself. Though PHP is a great language, I have found on numerous occasions, that the PHP organization (php.net) has terribly inaccurate information.

Here's some examples:


  • Back in the day of PHP 5.2.17, the PHP website stated “Do not use with VC9 version of Microsoft C++”, but guess what, I did, and it worked flawlessly.
  • Today, with PHP 5.6.7, the phpinfo() function identified my intel Core i5 CPU as an AMD64 CPU. 
  • With PHP 5.6.7, phpinfo() listed the path to my php folder as C:\php, even though I had named the folder “PHPx64” and listed it as such in the windows “path” and “PHPRC” enviornment variables, as well as the Apache “PHPIniDir” directive, and, of course, the php.ini configuration  file.
  • Also phpinfo() stated that no php.ini configuration file was loaded. And yet, the PHP core still worked, though it just wouldn't load any extensions.


So, I went back and changed the path to my PHP folder to “C:\php”, in every applicable place (Windows “path” and “PHPRC” enviornment variables, php.ini configuration file, Apache “PHPIniDir” directive, Apache “LoadModule” directives). 
Now phpinfo() shows that my “php.ini” configuration file is loaded at “C:\php\php.ini”. That's one step forward, but PHP still won't load any extensions. 

Now most of the PHP extensions are in the “php/ext” folder, and I had listed “php/ext” as the path to the extensions in all the appropriate places, but this had no effect,and PHP would not load extensions. So I reverted to “C:\php” as the path to the extensions, in every place except the “extensions_dir” directive in the “php.ini” config. file, this I set as “C:\php\ext”, which is what I had originally set it to, but extensions weren't loading so I set it to “C:\php”, but that didn't work either, so I just reverted back to “C:\php\ext”.

Anyway, here's the settings that finally worked:

PHP folder name: “php” in lowercase. PHP 5.6.7 doesn't seem to recognize anything else.

Windows “path” and “PHPRC” enviornment variables: “C:\php” . Note: You will have to create the “PHPRC” enviornment variable, it does not exist. Go to “Settings”--> “Control Panel” → “System” → “Advanced System Settings”. At the lower right-hand corner of the “System Properties” box click on “Enviornment Variables”. In the lower box, called “System variables”, click on “New”. Enter the name “PHPRC” and the value “C:\php” .

In your Apache/conf folder, open the configuration file named “httpd” and add “LoadModule” directives to load the PHP extensions you want to use. The scroll to the very bottom of the page and write: 

          AddType application/x-httpd-php .php
                ( Make sure there's a space between “php” and “.php” )

          PHPIniDir "C:/php"


In your php folder, open the configuration file named “php” (note it may not have the “.ini” extension). Look to the right of the filename and make sure it says “configuration Settings”. Scroll down until you see this heading:
                                        ;;;;;;;;;;;;;;;;;;;;;;;;;
                                        ; Paths and Directories ;
                                        ;;;;;;;;;;;;;;;;;;;;;;;;;

              Now scroll slowly until you see this section:

                                         ; Directory in which the loadable extensions (modules) reside.
                                         ; http://php.net/extension-dir
                                         ; extension_dir = "./"
                                         ; On windows:
                                           extension_dir = "C:\php\ext"

 Set “extension_dir” to “C:\php\ext, as shown above, and remember to remove the  semicolon from the beginning of the line.


   And that's it . I hope this works for you as it did for me. Thanks for reading.

Wednesday, May 6, 2015

How To Install Apache And PHP On Windows 8

Copyright 2015 Albert E. Benjamin

I've been trying to install the Apache web server and the PHP scripting language on Windows 8.

 I've installed both of these on Windows XP, and Windows 7 without any problems, but I had a lot of trouble installing them on Windows 8 (8.0 , I never upgraded to 8.1), although I finally got it done. Don't worry about the version though. I don't see any reason why this won't work on Windows 8.1, since neither Windows or Apache or PHP was the problem. The problem was bad instructions,everywhere !

 I spent about 6 hours a day for the better part of a week looking for, and trying advice from a multitude of sources on the internet, and I'm sad to say, not one of these solved my problem.

 So I want to share my solution here, so that hopefully, no one else has to go through this nightmare. So let's get started.


Step 1:


 Download and install "Visual C++ Redistributable for Visual Studio 2012 Update 4" from: http://www.microsoft.com/en-us/download/details.aspx?id=30679
It will normally install itself without any fuss.


Step 2:

 Download PHP 5.6.8 " VC11 x64 Thread Safe" from: http://windows.php.net/download/ Also download the "Debug Pack". Do not install at this time.
 You may notice that it says " Note: x64-builds are currrently experimental ". If you are uncomfortable with this, then download PHP 5.6.8 " VC11x86 Thread safe" instead.


Step 3:

Download "Apache 2.4.12" from:  https://www.apachelounge.com/download/
Do not install at this time.
If you downloaded the x64 version of PHP, then download:

          Apache 2.4.12 Win64" (httpd-2.4.12-win64-VC11.zip)

 If you downloaded the x86 version of PHP, then download:

         Apache 2.4.12 Win32" ( httpd-2.4.12-win32-VC11.zip) .

These will be the first two downloads you will see on the page.

 

Step 4:
 Click on the downloaded Apache  folder. It should be a folder Icon with a zipper, and when you click it, it will open a file explorer window.
 At the top of the window select "Extract All". This will open a dialog box which will show you where the folder will be extracted, and give you the option to change that location. Change the location to "C:"  and extract the folder. It should create a folder on your hard drive named "Apache24" .  So you should have C:\Apache24 .

Step 5:
  Extract  the downloaded PHP folder to C: in exactly the same manner as you extracted the Apache folder. Now rename the extracted php5.6.8 folder with it's long name to simply "PHP" . You may get a warning stating that changing the folder name may cause the program not to work. Go ahead and change the folder name.                  

 
Step 6:

Now we need to edit the "path" enviornment variable in Windows 8. Swipe the right-hand side of your desktop to get to the "settings" gear icon. Click on this icon and select "Control Panel".

 Once you're in control panel, select "System" then click Advanced System Settings.

 Now click "System Properties", then click the  Enviornment Variables button.

Scroll down to find the "path" variable (Don't confuse with "PATHEXT"). Click on this variable to highlight (select) it, and then click the "Edit" button at the bottom of the window.
The Edit System Variable box comes up. In the box labeled "variable value", click on the text to highlight it, then hit the "Home" key on your keyboard to place your cursor at the beginning of this line of text. Using the right-arrow key on your keyboard, move all the way to the end of this line of text, then type a semicolon, followed by "C:\PHP" without the quote marks. Click "OK" and close all the windows/dialog boxes, and close control panel. Now restart your computer. When your computer restarts, you are ready to install Apache and PHP. 

Step 7:
Now navigate to your PHP folder and find the files:
      "php.ini-development" and "php.ini-production"

If you are new to PHP and aren't sure how you want to use it, choose "php.ini-development" ,you can change it to "production" at any time.

If you are seriously developing a project, choose "php.ini-production".

Change the name of your chosen file to "php.ini"

Don't make any other changes to PHP at this time. 

Exit the PHP folder.

Step 8 (Install Apache): 
Go to the "Start" screen and find the command window icon. Right-click it and select "Run As Administrator". Change directory by typing "cd C:" or "cd.." in the command window. If "cd.." doesn't take you to C:, the repeat the action. When you have the C:\> prompt , then type "cd Apache24". Now type "cd bin". The prompt should now read "C:\Apache24\bin>" Now type httpd -k install  . Apache should install smoothly unless it can't bind to (use) port 80, in which case you will have to go into Windows Firewall and allow Apache through the firewall. That's a subject I'll have to cover in another post.

Close the command window and navigate to the Apache24 folder on your hard drive. Open the folder and then open the "bin" sub-folder. In the "bin" folder, double click "ApacheMonitor" . You should now see one of the following icons in the taskbar:
       or --------------->


You should see the icon with the green arrow inside it. This means that Apache is working.


Now click on the Apache feather icon to turn off Apache. When the center of the icon turns red, Apache is turned off.

Step 9:
Navigate to the Apache24 folder, then open the "conf" sub-folder.
Open the file named "httpd". Scroll down the file until you see a bunch of lines that begin with "LoadModule". Scroll to the end of these, and immediately after the last one type:

LoadModule php5_module "C:/PHP/php5apache2_4.dll" 

Now scroll to the very bottom of the page and below everything else on the page, type:

AddType application/x-httpd-php. php   Be sure to leave a space between the "php." and the second "php"  .

Next, type:  PHPIniDir "C:/PHP"

Now save the file and restart Apache by clicking the feather icon.

Step 10:
Now you can test PHP by writing a simple script as follows, and placing the script in the Apache/htdocs folder.

Write the following PHP code in a text editor such as "notepad" :
    
           <? php

                Echo "Hello world";

           <?

Save it as "hello.php" and place it in the Apache/htdocs folder.
Now open your browser and type " http://localhost/hello.php " without the quote marks.
If you see just the plain text: Hello World, then PHP is working. if you see the PHP tags 
( <?php  and ?> ) something's still not working.

Step 11:

 Now you will want to edit your PHP configuration file to turn on the PHP features you want. The configuration file should be named simply "php", and have a gear icon.There are 3-files in my PHP folder named "php, but they have different icons, so be careful to choose the one with the gear icon.

 
Well I hope this works for you as well as it has for me. Thanks for reading.


Albert Benjamin

Ketonetic

 



 











Monday, May 4, 2015

Will Not Load " php5apache2_4.dll " on Windows 8

Copyright 2015 Albert E. Benjamin

If you install apache in a command window, you will get an error message stating that "php5apache2_4.dll is not a valid win32 application". This is usually caused by not having matching versions of PHP and Apache.

First, determine whether your Windows system is actually 32-bit or 64-bit. To determine this, go to "Settings---> "Control Panel"---> "System"---> :"System Information".

After you determine whether you have a 32-bit or 64-bit system, then download the appropriate PHP and Apache versions.
     For 32-bit systems:  PHP5.6.xVC9x86.  and Apache apache2.4.xVC9x86.
     For 64-bit systems: PHP5.6.xVC11x64 and Apache 2.4.12VC11x64.

Also, they must both be either "Thread Safe" or "Non-Thread Safe". 

Note that the PHP site (php.net) states that the 64-bit versions are experimental. If you're uncomfortable with this, then download the 32-bit versions of both Apache and PHP.

Also, I recommend the binaries from "Apache Lounge".