ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Someone suggested a change to one of our php web pages, so I vi'd the file, commented out the two lines he wanted changed, typed in the two almost identical lines, then saved. Now when I go to load the php page, it doesn't load!
Did I do something wrong or very bad? Even if i comment out the lines i added and uncomment the two old ones, it still won't load.
Thanks. It seems like whenever I try to comment out individual lines with two slashes, that's what kills it. I just removed the stuff for now to avoid chaos. I'll have to add them back in then see what the log says. Thanks!
Maybe. Happens to me too... It is possible that when the file was edited you might of changed something else besides those particular lines. Check the error log files.
Thanks. It's very weird. I take out those 2 lines I added in, it doesn't load. I delete the two slashes before the two lines that I commented out, and it loads again. it doesn't like my slashes. I'll have to fiddle with it some more when I get some downtime on that system. Good to know where to look though. Thanks.
OK, I'll give that a try too. This php file is littered with // though, so I'm not sure why mine wouldn't work. it did accept the /* */ to comment out the two lines though. Very odd.
php for websites often switch in and out of php on the fly. You can switch out of php and into regular html with a
Code:
?>
and then switch back to php with
Code:
<?php
"//" is a valid comment in php, but not in html. Maybe the problem is you're in an html section of the code and are trying to use "//"? Although I'm not sure why /* */ would work in that case.
Last edited by suicidaleggroll; 07-29-2014 at 09:51 AM.
That's an interesting little tidbit. And I wonder if that might have been the case. and I see an error in my original post, I believe it actually just loaded a blank/all white page, it didn't "not load" as in "this page can't be found" type warning, so maybe it was telling me the html was busted so it skipped all the other stuff.
Something else that you ought to be doing is ... source-code control!
In other words, you make the change to the file, and then you "commit" a branch containing the change into the source-code control system (say, "git"), tagged to the particular trouble-ticket or work-order that prompted the change.
You then "check out" that branch onto a test server, and thoroughly validate the change. If the change is good, it's merged onto the appropriate test-branch (and validated again). In due time, the test-branch is merged into a branch off of production corresponding to a "release candidate."
The only way that the production files can get changed is by "checking out" a particular approved release-candidate branch onto that server. Files are never changed directly, and the "correct state" of the server always corresponds exactly to a particular branch and a particular tag within that branch. Thus, the server can always be reverted to any other knowngood state in a matter of milliseconds.
Last edited by sundialsvcs; 07-30-2014 at 08:49 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.