Page 2 of 3

Posted: Mon May 28, 2007 8:22 am
by feyd
Restarting Apache?

Posted: Mon May 28, 2007 8:32 am
by bruceaj
Yes, I restarted Apache.

Thanks..

Configuration problem still not solved!!!

Posted: Wed May 30, 2007 2:20 pm
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..

Re: Configuration problem still not solved!!!

Posted: Wed May 30, 2007 2:35 pm
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().

Posted: Wed May 30, 2007 3:53 pm
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....

Posted: Wed May 30, 2007 3:56 pm
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.

Posted: Wed May 30, 2007 4:35 pm
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).

Posted: Thu May 31, 2007 7:27 am
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?

Posted: Thu May 31, 2007 8:29 am
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?

Posted: Thu May 31, 2007 10:22 am
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.

Posted: Fri Jun 01, 2007 8:23 am
by bruceaj
I tried httpd -k stop and get an error message "No installed service named "Apache2"" Strange since Apache is running..

Posted: Fri Jun 01, 2007 8:27 am
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.

Posted: Fri Jun 01, 2007 8:27 am
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.

Posted: Sun Jun 03, 2007 4:54 pm
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.

Posted: Sun Jun 03, 2007 5:00 pm
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!!