Page 1 of 2

Xampp PHP in Dreamweaver environment

PostPosted: 18. July 2012 07:17
by cyberbaffled
This is a long shot, but the Dreamweaver "developing server-side applications" forum directed me to this forum for possible insight into this discussion post:

"I have successfully installed an Apache server and MySQL using Xampp. Using Dream Weaver (CS5.5) I've created .php pages which (after setting up the site and testing server) successfully connect to a database. However, php code on those pages won't execute. The pages only display the text code when IE or Firefox links to http://localhost/filename.php. Following is the Apache log file entries for those failed attempts. [Tue Jul 17 08:20:03 2012] [notice] Child 2656: Starting thread to listen on port 443. [Tue Jul 17 08:20:03 2012] [notice] Child 2656: Starting thread to listen on port 443. [Tue Jul 17 08:20:03 2012] [notice] Child 2656: Starting thread to listen on port 80. [Tue Jul 17 08:20:03 2012] [notice] Child 2656: Starting thread to listen on port 80. [Tue Jul 17 10:38:28 2012] [error] [client ::1] script 'C:/Program Files/xampp/htdocs/phpinfo.php' not found or unable to stat [Tue Jul 17 10:51:25 2012] [error] [client ::1] script 'C:/Program Files/xampp/htdocs/phpinfo.php' not found or unable to stat I've run out of ideas about how to solve this. Anyone?"

In my reply to my own above post I added the information that the phpinfo() link in the xampp control panel generates the expected php information table, so it seems implicit that PHP is running in the context of xampp.

Why it won't run in the Dreamweaver environment I don't have a clue, and I'm hoping someone attending to this forum might.

Re: Xampp PHP in Dreamweaver environment

PostPosted: 18. July 2012 07:36
by JJ_Tagy
'C:/Program Files/...'

Location is a bad idea for xampp

Re: Xampp PHP in Dreamweaver environment

PostPosted: 19. July 2012 02:40
by cyberbaffled
There is that space between the two words, but xampp apache and sql work fine in that folder.

Re: Xampp PHP in Dreamweaver environment

PostPosted: 19. July 2012 05:22
by Altrea
cyberbaffled wrote:There is that space between the two words, but xampp apache and sql work fine in that folder.

You wanted to get a possible inside.
Apache and it's modules originally came from the *nix world so it is highly recommend to install xampp to a path with only a-z A-Z 0-9 or _

In perceived 99% of all Dreamweaver threads here the Problem is the Dreamweaver configuration (especially if the issue only occurs in the Dreamviewer preview function and not if the file is cleanly requested by the browser)

PHP seems to be running on your machine, so let us concentrate on the requirements for processing php code for you as checklist:
  • The file needs to have a file extension which is configurated in the HTTP Daemon to be send through the php interpreter (very common .php)
  • The file contents has to be saved in a charset which the PHP interpreter can understand (latin1 or UTF8 for example)
  • If using UTF8, the file must not have a ByteOrderMark (BOM)
  • PHP blocks in that file need to be placed after an opening php Tag (<?php, if short_open_tag is activated <? works too)
  • The file needs to be requested with the correct URL by a browser (simply opening it in file context in the browser like double clicking, drag and dropping, open dialog, etc don't work)
  • The requested HTTP Daemon as well as PHP needs to be activated and running

Some issues are not directly transparent. For example if your sourcecode is copied and pasted from another website or document it is possible, that the letters are looking identically to that you need but are saved in a different charset so that they gets misinterpreted by the php interpreter.

In some cases some users misinterpret the result they get from the browser. So, what does "php code don't execute" means in your case?
Do you see PHP code outputted in plain text?
Do you see PHP code outputted in the browsers sourcecode view?
Are your PHP codes only gone and replaced by nothing in your sourcecode view?
Do you get any visible error messages?
Are there any error messages in the php_error logfile?

best wishes,
Altrea

Re: Xampp PHP in Dreamweaver environment

PostPosted: 22. July 2012 03:54
by cyberbaffled
Let's assume hypothetically that the problem is Xampp installed not in c:\ but in c:\program files\ and either xampp can't find the php server or vice versa. So that I don't have to go through the time consuming process of uninstalling xampp and reinstalling it into c:\, are there any (windows 7) commands such as PATH that will guarantee that every serve within the xampp environment can find files in htdoc folder?

Also, how is it possible that the ..\xampp\php\conf folder is empty? The conf folders for apache, mysql, fpd, etc. have files in them. Folder xampp/php/conf does not.

Also, I've forgotten how to generate the xampp control panel that has the phpinfo() link. As I wrote in my first post, selecting that link generates the expected PHP table. Now I need that PHP table to determine what version of php (may possibly have been) installed. There are no files in the ../xampp/php/ folder that discloses this.

Re: Xampp PHP in Dreamweaver environment

PostPosted: 22. July 2012 12:37
by Altrea
cyberbaffled wrote:Let's assume hypothetically that the problem is Xampp installed not in c:\ but in c:\program files\ and either xampp can't find the php server or vice versa.

No, that's not your problem, but installing XAMPP in that folder can produce other problems, especially with Perl, PEAR or OpenSSL.

cyberbaffled wrote:So that I don't have to go through the time consuming process of uninstalling xampp and reinstalling it into c:\

Maybe you don't need that. Stop all your XAMPP processes and services, unregister the services, move your XAMPP folder into C:\ and run the setup_xampp.bat script.
That cost just 5 Minutes of your time i think.

cyberbaffled wrote:are there any (windows 7) commands such as PATH that will guarantee that every serve within the xampp environment can find files in htdoc folder?

I don't understand the question, sorry. XAMPP doesn't use PATH variables or registry keys.
I have posted you the requirements for the php parser. Your Apache gets the request, is looking for the MIME Type of the request, checks of there is a rule for that type and acts as the rule wants (e.g. send the file through the php interpreter).

cyberbaffled wrote:Also, how is it possible that the ..\xampp\php\conf folder is empty? The conf folders for apache, mysql, fpd, etc. have files in them. Folder xampp/php/conf does not.

The folder \xampp\php\conf\ doesn't exist. There is a folder \xampp\php\cfg\ and that this folder is empty is absolutely normal and does not have anything to do with your issue.

cyberbaffled wrote:Also, I've forgotten how to generate the xampp control panel that has the phpinfo() link.

You mean that orange XAMPP Administration page? Well normally that can be requested with the URL http://localhost/ or simply by clicking the Apache "Admin" Button in the XAMPP control panel (which does the same - requesting the page)

You don't say anything about the other things i said in my last post. I think they are very important to solve your problem. But it's up to you, it is your issue, not mine.

best wishes,
Altrea

Re: Xampp PHP in Dreamweaver environment

PostPosted: 22. July 2012 23:58
by cyberbaffled
To the extent I understand your suggestion, none of them designate an issue with my Xampp installation. Yes, it's true that I " see PHP code outputted in plain text". I've uninstalled Xampp and reinstalled in C:\ and the inability to execute php code persists, in either a Dreamweaver Live View context or by opening the url http://localhost/filename/ in a browser. Persists, that is, except for the phpinfo() link on the "splash" page which functions correctly. In both cases of an attempted php execution the file is in the htdoc folder.

Re: Xampp PHP in Dreamweaver environment

PostPosted: 23. July 2012 04:31
by Altrea
Because the orange XAMPP Administration Page and phpinfo() are working as expected it is very common that there must be something wrong with your file.
Are you willing to send me that file via E-Mail to check it by myself?

best wishes,
Altrea

Re: Xampp PHP in Dreamweaver environment

PostPosted: 23. July 2012 05:27
by cyberbaffled
Yes, I will. It's late tonight. My recollection is that you emailed me early on. Tomorrow I'll attempt attaching the file to email to you.

Re: Xampp PHP in Dreamweaver environment

PostPosted: 25. July 2012 18:38
by cyberbaffled
Either yestersay or the day before I used this forum's private email messaging system to copy a php file that fails to execute in an email to Altrea.

Re: Xampp PHP in Dreamweaver environment

PostPosted: 25. July 2012 21:00
by Altrea
Because it contains no private data and because i would report the issue and solution here anyhow for community reasons, i can do it now too.

That's what you send me:
cyberbaffled wrote:Altrea,
Copied below is the php file that won't execute when linked to in a browser or using "Live View" in Dreamweaver. However, reiterating what I've already said, the phpinfo() link on the Xampp splash page does bring up the expected table of information.

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PHPinfo</title>
</head>

<body>
&lt;? php phpinfo(); ?&gt;

 Thanks greatly for attending to this.

</body>
</html>


And that is what i answered:

Altrea wrote:
&lt;? php phpinfo(); ?&gt;

Two things:
- HTML Entities will not work! replace &lt; with < and &gt; with >
- there is a space between < and php

best wishes,
Altrea

Re: Xampp PHP in Dreamweaver environment

PostPosted: 31. July 2012 18:52
by cyberbaffled
These ideas didn't influence the problem. However, for some reason this discussion appears as "solved", which it isn't, so I'm reinitiating the discussion with new information.

php won't execute in an Xampp installed/Window 7 environment

PostPosted: 31. July 2012 19:11
by cyberbaffled
The most elemental php files won't execute in an Xampp/Windows 7 installation. Initially, the problem was that the code would print as text. Then, using instruction from an O'Reilly text I added to the conf file one LoadModule and one AddType line of code. This changed the problem such that instead of my browser displaying text it generated the error message: "Diagnose Connection Problem", "The remote device or resource won't accept connection". My Windows 7 UAC is reduced to the minimum the slide bar allows. There are no messages in the Apache log file.

[EDIT by Altrea: merged, because it is the same issue - One thread per issue per user rule]

Re: Xampp PHP in Dreamweaver environment

PostPosted: 31. July 2012 19:11
by Altrea
cyberbaffled wrote:These ideas didn't influence the problem.

Thats your opinion only.

cyberbaffled wrote:However, for some reason this discussion appears as "solved", which it isn't, so I'm reinitiating the discussion with new information.

So, give us new information. I have pleased you to send me the file as email attachement (which is very uncommon at this board here) to analyse it by myself, but you didn't.
Your posted code is running on my test environment with the changes i reported here.

It is your problem, which i try to solve here. It is your duty to give is all information which is needed.
Otherwise your problem could not be solved. At the end it is fully up to you.

best wishes,
Altrea

P.S.:

cyberbaffled wrote:using instruction from an O'Reilly text I added to the conf file one LoadModule and one AddType line of code.

Which is unnecessary. XAMPP already has this lines of code in the correct setting. Your changes can produce new problems.

Re: Xampp PHP in Dreamweaver environment

PostPosted: 01. August 2012 00:08
by cyberbaffled
The ideas about changing the code "didn't influence the problem" because when the code was changed with those ideas the exact same problem continued to exist.

The "new information" was contained in the previous post: "I added to the conf file one LoadModule and one AddType line of code. This changed the problem such that instead of my browser displaying text it generated the error message: "Diagnose Connection Problem", "The remote device or resource won't accept connection".

Adding the two lines of code to the config file changed the problem from (1) the display instead of execution of code text to (2) the "connection" problem designated by the IE browser. So now the question is, what "remote device or resource" will not accept what "connection"?

You said: "I have pleased you to send me the file as email attachement (which is very uncommon at this board here) to analyse it by myself, but you didn't. Your posted code is running on my test environment with the changes i reported here."

I posted the same code that I would have emailed. What's the difference? Yes, that code is running in your test environment with changes you suggested, but that code with the changes you suggested is not running in my test environment; the problem that has existed from my first post.