View Full Version : Running a PHP server.

04-14-2008, 09:34 AM
I have a file php file I need run with apache. The file works fine on my local network. I need to reconfig it so it runs on my our website we have through you. I have it running off a port say 6000. It is using mysql to save data.
It is using a file transfer server. The file length is going to be about 100bytes of data.

I have the file in the (/etc/rc.d/init.d/my.php) folder.
and it has a include file the point to my database.

I have tried to restart the server a few time. My clients haven't been able to call into it.
1. do I need to active the port?
2. do I need to and the file to a apache.ini file or something?
3. is the anything I nee to add to my file besides (#!/usr/local/bin/php):)

I don't know anything about Linex or apache. but my IT guys. so any help
would be great. Thanks

04-14-2008, 12:09 PM
Why did you upload the file where you did? Normally you upload a php file to main /var/www/html directory or a directory within that. You have to install php via your Site Manager for php to work. You should not have to do anything with ports for php to work unless you are trying to do something "fancy". You shouldn't have to add (#!/usr/local/bin/php).

04-14-2008, 12:54 PM
I do have the PHP running. I am tring to have the PHP file running as a server. I have placed it in that folder cause that is where all the file exicute when you start up your site. I did get the file to run using Putty. But I need the site to run it automatically. I did change the rights so the file could be executed. The (#!/usr/local/bin/php) tell where the php.exe file is to run the PHP script.

04-14-2008, 03:23 PM
Ahh... ok now I see what you are doing. :) I should have realized when you mentioned /ect/rc.d/int.d

With your West Host account in order to get a file to run in that directory you need to add a symbolic link to it in /ect/rc.d/rc2.d directory. If you look in that directory you'll see the existing sym links for httpd and mysql along with others depending on what you may have installed on your site. You'll notice that there are two sym links for each service. One starts with S and the other a K. In the case of most services these lead to the exact same file in /ect/rc.d/int.d . The S preface files are for Start and the K for Kill of the services. They are processed both on startup and shutdown of account accourding the the number within the symlink name. By default you'll notice that httpd Start is 80 and it's kill is 20. Mysql start is 10 and it's kill is 90. So when your account starts up Mysql is loaded and then Httpd. On shutdown that is reversed. This may not matter for your purposes but you may want your service to start up after both MySQL and Httpd is running.

04-14-2008, 03:34 PM
Oh about the port thing. I don't think you'll have a problem if it is indeed set as high as you mention and the script is configured to listen on that port. It is the lower ports that are not available to use.