Linux - SoftwareThis 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
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.
I'm trying to get PHP to work on my linux server (It already works great on my Windows 2000 server - but that's a whole different distro of PHP of course...)
I added "AddType x-httpd-php .php" already
but PHP isn't an .so module, so where do I tell Apache about it?
How does it even know that there is a php.ini file in another directory?
I'm just wondering what I need to add in order for .PHP pages to function as PHP pages.
You wont need to add anything extra as the php.ini file loads all required modules automatically.
Now you are ready to test php!
create a file index.php under /var/www/html if you arent using virtual hosting. Otherwise, if you are using virtual hosting, then put index.php under /var/www/html/<your-domain-name>/
Creating a php file is quite simple too...just create a normal html file and embed php under it like this
I have a message board program (much like this one) written in PHP. It works great on my Windows 2000 box with that version of PHP - but I get a "server error" when I run it on my linux box. I've set the directory and all files to user/group "apache", and I think everything has the right permissions.
Is permissions the only problem I should look into? I was just wanting to verify that PHP was correctly installed.
Does the "execute" bit even matter for PHP scripts?
Well...I havent yet ventured into php much, but I think the execute bit wont matter here ( i'll have to confirm that, so right now its just a guess!)..
However, I'd like to know where do you get this "Server Error" ?...Is it right at where you launch index.php? or is it with some particular page? BTW where is index.php located ? Also, the execute permission for index.php may be a factor, so check that too..
Have u tried to execute a simple php script before trying to run your own program? Well, at least give the sample script a try and then let us know whats happening..
It might have something to do with the fact you have to files stored in the cgi-bin directory. Look through the httpd.conf to read what it says about that directory. I tried putting php in there and it didn't work giving similar errors.
That was one of my main questions actually - I guess I was a bit confused in my thinking there - after all, a PHP is not a cgi script, not even "kind of".
Are you still having trouble with this? I noticed that the links you supplied still don't work. I'll see if I can help you with this when I get back to my house and look at my setup.
Meanwhile, could you answer a few questions :
- What version of apache?
- What version of php?
- What distro are you using?
Also, could you post a bit of one of the pages that's not working? You also could try replacing one of the pages that doesn't work with one of your 'simple' pages that you've posted that will work. Save away the 'real' page and replace it with a page that you know works under that same directory and filename. That way, you can eliminate issues like what directory it's in and some of the bit twiddling questions that you have. I'm guessing that your page is using some facility like database access or similar that you don't have set up on your new machine.
I'll look back into this forum in an hour or so when I get home from work to see if you've made any replies. It will be late Sunday before I can check back after that.
I'm sure I can help you at least figure out what's going on, and we may actually be able to fix it. :-)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.