configuration problem

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Restarting Apache?
bruceaj
Forum Newbie
Posts: 16
Joined: Sun May 27, 2007 8:43 am

Post by bruceaj »

Yes, I restarted Apache.

Thanks..
bruceaj
Forum Newbie
Posts: 16
Joined: Sun May 27, 2007 8:43 am

Configuration problem still not solved!!!

Post by bruceaj »

I Still have not solved my original problem. Would some knowledgable person be willing to look at my php.ini and, if necessary, my apache.conf?

Or should I post here?

Thank you..
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Re: Configuration problem still not solved!!!

Post by superdezign »

bruceaj wrote:I Still have not solved my original problem. Would some knowledgable person be willing to look at my php.ini and, if necessary, my apache.conf?

Or should I post here?

Thank you..
Are any changes occurring in your phpinfo() when you change your php.ini? Oftentimes, when people install php, they have more than one php.ini on their computer (because the installation tells you to copy it, even though you don't have to if you know how to edit apache's config), and they edit the wrong one.

Just a suggestion. Give it a try. Change something where you know where it stands in phpinfo().
bruceaj
Forum Newbie
Posts: 16
Joined: Sun May 27, 2007 8:43 am

Post by bruceaj »

Your suggestion pointed me to the problem, "I think." If it's not the problem, it certainly was "A" major problem. phpinfo() stated that php.ini was in C:\windows and it was NOT. It was in c:\php. I moved php.ini to c:\windows and the problems "Seems" to have gone away. Because I am on a NEW machine, I need to setup an special login ID to use mysql with the program that was giving me the error. I'll work on that and get back when I know more.

BWT: Where did phpinfo() get the idea that php.ini was in C:\windows? I would like to change it back to c:\php if I can. Is it in apache.conf?

Thanks....
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

bruceaj wrote:Where did phpinfo() get the idea that php.ini was in C:\windows? I would like to change it back to c:\php if I can. Is it in apache.conf?
I do believe that it is (httpd.conf). Then again, might not be.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Check your error logs in Apache to confirm that the situation is indeed corrected. In the manual it discusses what to do when your installation directory and the directory of the ini file are different (and how to copy which files to where to get everything working properly).
bruceaj
Forum Newbie
Posts: 16
Joined: Sun May 27, 2007 8:43 am

Post by bruceaj »

Moving php.ini to C:\windows has fixed my problem. All my existing code now works.

I checked the documentation, and found
php.ini is searched in these locations (in order):

SAPI module specific location (PHPIniDir directive in Apache 2, -c command line option in CGI and CLI, php_ini parameter in NSAPI, PHP_INI_PATH environment variable in THTTPD)
I then experimented with PHPIniDir with the following:

#PHPIniDir = "c:/php/"
#PHPIniDir = c:/php/
#PHPIniDir = c:\php\
PHPIniDir = "c:\php\"

The first 3 caused apache NOT to load. The last one allowed apached to load BUT phpinfo() still showed c:\windows\php.ini,

Also, I am using Vista and the then ONLY way I can restart Apache is by restarting Windows. Clicking the restart icon on the task bar does nothing, nor does clicking restart under the Program listing for Apache.

Can someone give me any reason why restart doesn't work on Vista?
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Because it's Vista? :lol:

I've never use "Restart Apache" before... But, then again, I've never seen a reason to create a command-line run to both stop and start it.

I did realize though that if you allow Apache to start with Windows, via msconfig (not sure if it's still msconfig in Vista), it appears as a system task rather than a user task. Maybe that's the problem?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I think you can, at the command line, go into the apache folder (wherever the executable is) and issue the command

Code: Select all

httpd -k restart
Alternatively, you can issue the stop and start commands as well.
bruceaj
Forum Newbie
Posts: 16
Joined: Sun May 27, 2007 8:43 am

Post by bruceaj »

I tried httpd -k stop and get an error message "No installed service named "Apache2"" Strange since Apache is running..
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Look in your services panel for the service name it's running under.

While you can stop and start the service there, in the future you can also issue those same commands via the "net" command.

Code: Select all

> net stop Apache2
Service stopped successfully.

> net start Apache2
Attempting to start services..... success.
You should see something similar. Note that if there are spaces or "odd" characters in the service name you will need to double quote around the name.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Try this:

Code: Select all

C:\apache\Apache.exe -d "C:\apache"  -k restart
Of course, replace C:\apache with your apache folder.
bruceaj
Forum Newbie
Posts: 16
Joined: Sun May 27, 2007 8:43 am

Post by bruceaj »

superdezign wrote:Try this:

Code: Select all

C:\apache\Apache.exe -d "C:\apache"  -k restart
Of course, replace C:\apache with your apache folder.
I searched my computer for Apache*.exe and only found ApacheMonitor.exe. I tried your suggestion using ApacheMonitor and result was a return dialog saying ApacheMonitor was already started.
bruceaj
Forum Newbie
Posts: 16
Joined: Sun May 27, 2007 8:43 am

Post by bruceaj »

feyd wrote:Look in your services panel for the service name it's running under.

While you can stop and start the service there, in the future you can also issue those same commands via the "net" command.

Code: Select all

> net stop Apache2
Service stopped successfully.

> net start Apache2
Attempting to start services..... success.
You should see something similar. Note that if there are spaces or "odd" characters in the service name you will need to double quote around the name.
Thanks for the suggestion on the service panel. My service is named Apache2.2. From the service panel, I can stop and restart Apache. So the problem of not starting from the task bar might be that it's looking for Apache2 and not Apache2.2. Any way I can change this? Change the task bar to look for Apache2.2. I doubt if I want to rename the service, if I even can. If I reinstall maybe that there is somethere that asks me for the name of the service!!
Post Reply