LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-22-2012, 04:59 PM   #1
Basher52
Member
 
Registered: Mar 2004
Location: .SE
Distribution: Arch
Posts: 401

Rep: Reputation: 22
Post What to use to debug php/css


Is there a way to debug php/css code remotely?
I know there are a addon to firefox but that seem to just work on "pure" php and can't handle the rest of the code (or I can't use it correctly)
If I get a whole forums code/database from a site to my own server I want to make changes and debug that easily, like step by step as you can do in debugging other code,
I want to debug the code on this "remote" server.

My knowledge of php is not even close to what it should be and now I've been asked to make a big change to that forum so I need lots of help doing it.
This change involves functions that are only there for moderators but some of that code I want to add for normal users, so the basic of it all I can take from different places.
This probably needs some changes in the database too, most likely adding of columns to some tables.

Anyone know that I can use and if that involves the FF-addon then what am I missing.
 
Old 03-23-2012, 09:55 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
a browser add on can't really help much with server side code, as it never reaches the browser in the first place. php and css don't have much of anything in common either, as, unlike php, css is client side, so the two do their thing potentially thousands of miles apart...
 
1 members found this post helpful.
Old 03-23-2012, 01:56 PM   #3
Basher52
Member
 
Registered: Mar 2004
Location: .SE
Distribution: Arch
Posts: 401

Original Poster
Rep: Reputation: 22
so there's really no chance of debugging the code then
So why the AddOn to firefox then? most stuff of the php code comes from a database and are used to generate html code, I don't get it :P
 
Old 03-23-2012, 02:09 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
how is a browser on your desk meant to have any input on code which is executed on the server? And "coming from the database" is even further away from a browsers remit.

It sounds like you're not really sure what you want to achieve in the first place, given the confusion between php and css. There are excellent tools like Firebug, but you need to know why you want to use them first.

Last edited by acid_kewpie; 03-23-2012 at 02:27 PM.
 
1 members found this post helpful.
Old 03-23-2012, 03:55 PM   #5
Basher52
Member
 
Registered: Mar 2004
Location: .SE
Distribution: Arch
Posts: 401

Original Poster
Rep: Reputation: 22
I'm an old programmer from the C# side(sorry for cussing) and in that you can debug every line of code include database code.
Since I'm not good enough at php I need to do a lot of debugging and see what happens in the code and how it will use the database data to produce the
html code that later will be shown.
Is the only thing I can do to learn php up to 90% so I can write all the code by hand and in my mind "see" what'll happen?

Firebug, think that was the thing I tried and sorry for asking, what is that? I thought it was a debug tool for php
and hence php inside html. Pure php, for me anyways, is useless since it's used to produce html code.

or am I way off?
 
Old 03-23-2012, 04:06 PM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Yes, you're way off, you're making invalid comparisons between things that are not possible to compare, and you don't seem to understand the difference between clientside and serverside execution. Don't compare C# and PHP. Compare ASP or JSP to PHP. There are plenty of ways to debug it, but you need to first understand what there is to debug. you can enable PHP warnings etc, to let errors be printed into your code, you can write debugging messages to log files on the server, but this code runs on a SERVER, not a BROWSER.
 
1 members found this post helpful.
Old 03-23-2012, 04:26 PM   #7
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
There's a runtime config directive you may be interested in:

http://www.php.net/manual/en/errorfu...display-errors

When set, it'll barf out errors and warnings (depending on how the error_reporting directive is set) to your rendered page. Note the caveat about using it on production systems.
 
1 members found this post helpful.
Old 03-23-2012, 05:10 PM   #8
Basher52
Member
 
Registered: Mar 2004
Location: .SE
Distribution: Arch
Posts: 401

Original Poster
Rep: Reputation: 22
I know the difference between server side and client side execution but then I wonder how my old work mates debugged asp code in Visual Studio as I saw them stepped through the code line by line... ah well... lol

I got too little time to learn php and I'm gonna study that link you got me a lot, thx.
This type of thing though, just have to take a lot longer to debug then what I'm used to if you are like me a novice of the art of php, since you have to put like message boxes of variables and stuff
all over the place, nothing to do then just learn I guess lol

Can I buy some free time from anyone :P :P

Thanks again for helping me out
 
Old 03-23-2012, 05:15 PM   #9
Basher52
Member
 
Registered: Mar 2004
Location: .SE
Distribution: Arch
Posts: 401

Original Poster
Rep: Reputation: 22
oh btw... is there no server side debug tool that might help me better?
 
Old 03-23-2012, 05:26 PM   #10
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
A quick 'net search turned up these (all of which I consider to be credible sources):
I develop a handful of small, internally-facing PHP apps, so display_errors and some contrived tests (with echo statements) has been sufficient for me. YMMV.
 
1 members found this post helpful.
Old 03-23-2012, 05:48 PM   #11
Basher52
Member
 
Registered: Mar 2004
Location: .SE
Distribution: Arch
Posts: 401

Original Poster
Rep: Reputation: 22
thx

Appreciate your links, hope I didn't get on your nerves too much, lol
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP , HTML and CSS talk / guides silvyus_06 General 6 03-08-2012 02:46 PM
php not calling css correctly jus71n742 Programming 1 02-14-2009 10:25 PM
php with css doesn't display properly htamayo Programming 3 04-15-2008 06:35 PM
CSS/HTML/PHP/OBJECT Question br00tal Programming 3 04-10-2008 10:37 PM
Problem loading css in php Runnerdave Programming 6 07-26-2005 08:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration