LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-20-2005, 11:51 AM   #1
Herbalist
LQ Newbie
 
Registered: Jun 2005
Distribution: Blag
Posts: 8

Rep: Reputation: 0
PHP not Executing Sometimes


At least I think that is what it is doing. Well first of all I'm very new to linux [only been using it for a week] and I have my website up and running the way I want it [this question is more out of curiosity]. But durring the building phase I was running into problems with PHP. For example; I tried to have a drop down menu so users could select different styles, but when you picked one, all you got was a blank page. The same thing happened when I tried a Guestbook/Shoutbox, when you hit 'Submit' all you got was a blank page. And in all the cases where this happened the address bar had the path the the 'whatever.php' page. So my question is.........what could have caused this to happen? Was it a 'permission' thing? Or maybe my PHP wasn't configured right? Anyway, this has been driving me nuts.

For the 'www' folder and the sub-folders and files
Owner = Me
Group = Apache
Is that OK, or should it have a differnet owner and group?

I really Like Linux and will never use Windows again [it crashed and I lost everything] but my biggest problem with linux is the 'permissions' concept. In Windows I just put the script in my 'httpd' folder opened up my browser and it just worked, not with Linux.

I really hope this is the Right Section to post this, I wasn't real sure, as it pertains to Programming and Linux
 
Old 06-20-2005, 12:09 PM   #2
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Rep: Reputation: 103Reputation: 103
Re: PHP not Executing Sometimes

Quote:
Originally posted by Herbalist
At least I think that is what it is doing. Well first of all I'm very new to linux [only been using it for a week] and I have my website up and running the way I want it [this question is more out of curiosity]. But durring the building phase I was running into problems with PHP. For example; I tried to have a drop down menu so users could select different styles, but when you picked one, all you got was a blank page. The same thing happened when I tried a Guestbook/Shoutbox, when you hit 'Submit' all you got was a blank page. And in all the cases where this happened the address bar had the path the the 'whatever.php' page. So my question is.........what could have caused this to happen? Was it a 'permission' thing? Or maybe my PHP wasn't configured right? Anyway, this has been driving me nuts.


No I don't think this is permissions. A blank screen in a PHP site can mean quite a lot of things. In the PHP sites we develop at Polar Design, a blank page usually means that a "select" statement has fallen through due to a subfunction call being misspelled or typed incorrectly. I doubt if this is your problem - you say it "sometimes" does not execute? That is extremely strange - it it supposed to either work or not - consistently. Maybe "post" forms is disabled in your PHP settings? I don't know if that is possible, but since you can either HTTP "post" form data or HTTP "get", I am guessing that either of these functions / function sets is disabled in your PHP installation (if that's even possible) and now it seems to you as if some forms work and others do not - since some forms -might- use get to store data and others use post to store data.

Quote:
For the 'www' folder and the sub-folders and files
Owner = Me
Group = Apache
Is that OK, or should it have a differnet owner and group?
The permissions you set should normally have no effect on how the script executes. If you can browse to it and get a response from it, your permissions are in order for browsing. If your permission were wrong, you'd be unable to navigate to the page. In that sense permissions has no effect on the type of problem you describe.

Quote:
I really Like Linux and will never use Windows again [it crashed and I lost everything] but my biggest problem with linux is the 'permissions' concept. In Windows I just put the script in my 'httpd' folder opened up my browser and it just worked, not with Linux.
Well, that's one of the main strengths of Linux and Unix-like operating systems - the permissions system. If it just bothers you or gets in your way, try

chmod -R a+rw *

in all directories that you wat to behave like your Windows "httpd" folder.. This will make the directory contents and all subdirectories and files of that directory world-writable, which means ANYBODY can read AND write (and also delete) files in that directory and all its subdirectories. Functionally, this is then a "Windows" directory with no permissions. For the Apache htdocs directory, you more likely want

1. chmod -R a-rw *
1. chmod -R u+rw *
1. chmod -R og+r *

(note I am working from memory, don't trust me on these! Test them first somewhere safe)

These should mean

1. Make nobody besides root able to read or write ANY file in htdocs.
2. Make the user (i. e. the guy who created a file) able to create/write/delete/read files created by him.
3. Make everybody else ((o)thers and (g)roup)) only able to read files, not write, create, or delete any.

Quote:
I really hope this is the Right Section to post this, I wasn't real sure, as it pertains to Programming and Linux
 
Old 06-20-2005, 01:04 PM   #3
Herbalist
LQ Newbie
 
Registered: Jun 2005
Distribution: Blag
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks for the Reply. You answered a couple of questions.............Thanks!
 
Old 06-20-2005, 07:41 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
This is a VERY useful site to bookmark (if you haven't already got it).
http://www.php.net/manual/en/
Basically the full PHP manual (searchable) with examples for every cmd
 
  


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
Apache/PHP: Executing 'at' scheduled jobs? bomix Linux - Software 11 01-23-2009 01:02 PM
How executing c program with php? payal_shah Programming 6 04-08-2005 10:44 PM
Executing C program within PHP to Acces low level I/O rcohen Linux - Software 3 02-28-2005 11:26 AM
Executing PHP script- error message vfulco Linux - Newbie 3 07-13-2004 10:55 PM
Executing Javascript within a PHP page Linh Programming 3 09-26-2003 05:08 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:03 AM.

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