[FGA] Frequently given answers

Problems with the Windows version of XAMPP, questions, comments, and anything related.

[FGA] Frequently given answers

Postby Altrea » 05. February 2014 06:15

This thread will contain answers the helpers are given way to often.

Contents

P.S.: Any information not clear enough here or any ideas for FGAs? Write me a PM.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 6471
Joined: 17. August 2009 13:05
XAMPP Version: 5.5.19
Operating System: W7Ux64

[FGA] Insufficient debug information

Postby Altrea » 05. February 2014 06:16

What can you expect from this thread?

A helper is of the opinion, that you don't provide enough information you could have given to identify either your problem or the next steps of debugging. Because that happens way to often, this frequently given answer post here is created to give you detailed instructions, what you can do better to help us helping you.


Which information is needed?

XAMPP version
This should contain;
  • version number (can be found in your \xampp\readme_en.txt file or at the orange XAMPP administration page)
  • bundle version (full, portable, lite)
  • install file type (.exe, .zip, .7z)
simplest to copy the full filename you have downloaded (e.g. xampp-win32-1.8.3-2-VC11.zip)
P.S.: v3.2.1 which can be found in the control panel is not a valid XAMPP version number, thats the version number of the control panel component only.


operating system version
This should contain:
  • Major version (Windows 8.1 for example)
  • edition (RT, Professional, Ultimate, Enterprise, Embedded, etc.)
  • bit compilation (32bit/x86 or 64bit/x64)
  • Service Pack level (e.g. SP1)

XAMPP installation path
Examples:
  • C:\xampp\
  • J:\xampp\ (portable usb device)
  • C:\Program Files (x86)\xampp\
  • C:\Users\UVW XYZ\Desktop\xampp-win32-1.8.3-2-VC11\xampp\
  • \\192.168.1.10\share\xampp\ (network share)

any configuration changes made since installation
Did you execute some script?
Or used the XAMPP security script?
Or changed anything in the config files?


full qualified issue report
This should contain three information
  • actions (What exactly do you do)
  • expected reactions (What do you expect should happen)
  • received reactions (What really happens)
This also includes full error messages


XAMPP control panel log
Either from the XAMPP control panel log window itself or from the \xampp\control-panel.log file
We need the entire log contents beginning with the line
[main] Initializing Control Panel



Log file contents of the specific component
Mostly accessible with help of the Logs buttons in the control panel

Example:
  • \xampp\apache\logs\error.log
  • \xampp\apache\logs\access.log
  • \xampp\php\logs\php_error_log
  • \xampp\mysql\data\mysql_error.log


Windows event log entries of the specific component
(only needed if running the component as windows service)


Updated information after changes
If you do any changes after providing us debug information the basic conditions will change. Maybe your general problem is not solved then but now the reasons for this can have changed. Already given information can now be different so check if they are and give us updated information so that we can reappraise the situation.


Any other by a helper requested information
Some issues require additional debug information to identify and solve it.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 6471
Joined: 17. August 2009 13:05
XAMPP Version: 5.5.19
Operating System: W7Ux64

[FGA] Apache won't parse php code

Postby Altrea » 11. February 2014 06:30

What can you expect from this thread?

Not parsed php code is a common issue reported several times before at this board and there are only a few reasons why this is happening.
This thread explains in detail how to identify and solve the most common reasons for this issue.


How to solve the problem?

short open tag issue

You are starting your php blocks with a short open tag
Code: Select all
<?
    //
?>

Short open tags are disabled by default in the current XAMPP versions because of wrong context issues:
php.ini comment wrote:It's been recommended for several years that you not use the short tag "short cut" and
instead to use the full <?php and ?> tag combination. With the wide spread use
of XML and use of these tags by other languages, the server can become easily
confused and end up parsing the wrong code in the wrong context.


Solution: use full open tags instead
Code: Select all
<?php
    //
?>


protocol or request issue

You have tried to open a php file by double click, drag and drop or the open dialogue of your browser or by executing a relative link from another file (e.g. a html form) opened with one of the mentioned methods. Your Browsers address bar will show an address beginning with file:// and/or a file system path.

This will not work because your browser will not request that file from a webserver. Instead your browser uses file system functions to directly open the file.
Your browser does not have any idea that this file needs to be send through an php interpreter first to be processed.

Solution: use an correct http url. Very common it should start with http://localhost/ (localhost is a default domain name routing back to your very own computer)


file extension issue

You are trying to use php code in html files.

This will not work because by configuration Apache will not send html files through the php interpreter. Although it is technically possible to configure Apache to send every wished file extension through the php interpreter it is best practice not to do so because it will increase processing time of files that don't contain any php.

Solution: Use the file extension .php


encoding issue

You are using an encoding which is not supported by the php interpreter. This can have several sideeffects. Your editor will very common don't show any difference in your code view. Maybe you can see in the status bar which encoding the file is saved with.

I will show you a few examples of encodings and their effects.

UTF-8 with BOM
Image
Effect: The BOM is outputted by the php interpreter and any php functions that need to be processed before any output (Cookie, Session, Redirects and other header() functions) will produce the following warning
Warning: Cannot modify header information - headers already sent by [...]


non ANSI encoding (here UCS2 big endian)
Image
Effect: PHP will not realize the start of the PHP-Block (like the short open tag issue).


Solution: Use the correct encoding (UTF-8 without BOM or any ANSI based encoding like ISO-8859)
Image
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 6471
Joined: 17. August 2009 13:05
XAMPP Version: 5.5.19
Operating System: W7Ux64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 72 guests