?
Solved

Dreamweaver PHP not displaying properly

Posted on 2010-01-05
22
Medium Priority
?
501 Views
Last Modified: 2013-12-13
I setup dreamweaver with a test server on my computer.

The database is connected fine, the ftp is connected fine, and the root folder is working... but when I open a PHP file, i still get php source instead of the actual document that it should be.

Is there something I'm missing? The php files work on the website server, but when i use localhost as a test server, i get nothing. I can see the php files working fine when i goto http://localhost/

Is there a setting somewhere that needs to be changed?
0
Comment
Question by:bsemailbs
  • 7
  • 7
  • 4
  • +2
22 Comments
 
LVL 45

Expert Comment

by:Chris Stanyon
ID: 26180288
Have you installed a web server (e.g Apache) with PHP on your computer?
0
 
LVL 10

Expert Comment

by:Terry_focus
ID: 26180580
is your php using short tags? if so is short tags enabled in php.ini?
0
 

Author Comment

by:bsemailbs
ID: 26180963
Yes, Apache is installed and working. I can view the pages in a browser.

Yes, PHP is using short tags. Yes its enabled in php.ini as: short_open_tag = On
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 45

Expert Comment

by:Chris Stanyon
ID: 26181496
You say that when you use localhost as a test server you get nothing, but then you also say that when you view localhost in a browser you see the pages fine. This seems like a contradiction.

If you view your site in a browser and the pages appear fine, then I can't see what the problem is.

If you mean you can't see the php pages WITHIN dreamweaver, then you're not supposed to. PHP is only parsed when ran through a server. The idea being that you code in Dreamweaver and then preview your site in a browser (hosted on your Test Server)

Sorry if I misunderstand what you mean :)
0
 

Author Comment

by:bsemailbs
ID: 26181607
You're right, I mean I cannot view them in dreamweaver the same way they are displayed in the browser... which you're supposed to be able to do, hence the reason for the DB connection and the "Live View" in dreamweaver... right?

I understand PHP needs a server to be parsed, which is why I created one for it to use... dreamweaver has all the connection information, and it connects to the local folder, remote folder, testing folder, and database just fine.

Adobe says "Adobe Dreamweaver CS4 offers a new Live View mode, an in-application browser based on WebKit that allows web designers to view site documents in a persistent view that changes as code is edited."

This is what I am trying to do...
0
 
LVL 45

Expert Comment

by:Chris Stanyon
ID: 26181811
Ah OK. I'm still on Dreamweaver CS3 and wasn't aware of the live preview. I tend to have Dreamweaver open for edits and the Test Site previewed in a browser. After edits I simply hit refresh in the browser and it shows the updates immediately.

Don't know anything about CS4 or Live Preview so can't help you any more. Sorry :(
0
 
LVL 4

Expert Comment

by:kent3800
ID: 26182088
Can you see the code fine when you have the code split between code and design?

My guess would be that you have a problem with your test server set up in Dreamweaver. Try reviewing and double checking this:
http://www.adobe.com/newsletters/edge/december2009/articles/article2/index.html?trackingid=FBTRR

In the past I've had to set up the test server and remote server as separate instances to get the Live Preview to work. Meaning the local test server is completely separate from the localhost remote server. If you can set it up so that the test server is local and the remote is actually remote it seems to work the best.

Also, verify the live view is set correctly in the preferences and that you have a browser defaulted for the preview.

0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 26182373
Hi bsemailbs,

Live View will also not run like a server/browser model completely.  Sometimes it will choke on perfectly valid (albeit complicated) PHP code, especially code that is dependent on a MySQL lookup.

Otherwise, kent3800 is correct.  Make sure the testing server is different from the remote server (XAMPP is excellent for this) and rely more on true browser testing than Live View.
0
 

Author Comment

by:bsemailbs
ID: 26183926
Thanks... Thats actually the page I was working off of originally to set everything up... and its all working except for the preview of the page.
I switched the remote server to my actual remote server, nothing changed.

Yes, I can see the php code in split view, and the design page changes when I click live view.

I've been looking at this for a while, and it looks like its executing the code, but not completely. (by looking at the live code vs the normal code)

For instance, IF statements and basic functions are being run, but its not pulling the value for the variables or running other functions defined in include files in another folder... Is this what you're talking about jason1178?

I took a look at the live view settings, and I have java running and "use testing server for document source" checked (also tried it as unchecked).

I wasnt sure how to use the HTTP request settings, so they're blank.
0
 

Author Comment

by:bsemailbs
ID: 26184231
I forgot to mention I tried xampp for the server at first, but it cant run zend optimizer on windows 7 (not supported even though W7 is almost a year old)... so I had to download zend server CE, and use that instead.
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 375 total points
ID: 26184776
>> but its not pulling the value for the variables or running other functions defined in include files in another folder...
>> Is this what you're talking about jason1178?

Yup.  If you have lots of dependencies and includes being called in, Live View can choke.

Folks need to remember the market Dreamweaver is primarily aimed towards.  It generally expects a user to use the basic behaviors included in the software and it supports that code very well.  As soon as you move beyond the basics and start messing about with custom code, DW's ability to support all of its functions will be reduced.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 26184844
>> so I had to download zend server CE, and use that instead.

Are you coding within the Zend framework?
0
 

Author Comment

by:bsemailbs
ID: 26186059
hmm... well thats not good news :/ I hate re-doing complex table layouts by hand...

Nope, not coding within the framework, I just have one or two files that require it.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 26186086
>> Nope, not coding within the framework, I just have one or two files that require it.

Okay.  But don't expect live view to handle stuff dependent on those files.  You may just want to forget about live view and do all your testing from a real server.
0
 

Author Comment

by:bsemailbs
ID: 26186213
Yeah, I dont have those included in the files im working with...

But looks like im going to have to just work off the server in a trial-and-error method :(


Thanks everyone for your help.
0
 

Author Closing Comment

by:bsemailbs
ID: 31672907
dreamweaver cs4 needs improvement :(
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 26186424
>> dreamweaver cs4 needs improvement :(

Yup.  No arguments here.
0
 
LVL 4

Expert Comment

by:kent3800
ID: 26192827
if one is working with the Zend framework, what IDE do you recommend jason1178? I'm using Aptana which was good up until the last release where they dropped PDT support. I'm thinking about trying Eclipse PDT... Any other recommendations?
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 26192843
Eclipse PDT or the Zend IDE would be my choice at this point.  If I had to use Zend, I was using it with Aptana Studio but I don't like Zend and only touch it when I have to.
0
 
LVL 4

Expert Comment

by:kent3800
ID: 26193287
Are you a symphony guy? What are the drawbacks to Zend? Seems well documented.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 26193562
Symfony and Cake right now.  Actually working more with Django than any of the PHP frameworks if we're being honest.

I don't have anything against Zend's capabilities...I just found it difficult to deal with versus the others above.  It's a personal thing, apparently.
0
 
LVL 4

Expert Comment

by:kent3800
ID: 26193861
I'll definitely check those out. Good to have other's opinions when taking a giant leap from Dreamweaver to code IDE and frameworks. Thanks!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month17 days, 5 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question