I apologize in advance if this has been asked/answered already! I assure you, I did explore the question extensively before I asked.
What I am dealing with is pretty simple, but I am not actually sure it is an issue of port, though that is the only thing different.
I develop and host on the same machine. I run 2 actual websites (vhosts) that work fine once the code (cakePHP) is in production. But, when I debug in development (using PHP built-in server on 8080), I don't get any .htaccess response (mod_rewrite doesn't work).
I have the documentroot and directory set to my development folders in httpd.conf, and then of course my virtual hosts set up separately. As I mentioned, once the code is deployed to their production folders, everything works fine and as expected. My only issue is using localhost:8080 - it works, but rewriting isn't happening (so css, etc doesn't get loaded).
The title of the question assumes that the issue is the port. I haven't tried turning off apache and using PHP built in server on 80 to see if that works because my deployed apps are pretty much in constant use... I am considering firing up a virtual machine with the exact config and testing that theory, but I thought I would ask and see if anyone has any experience with particular problem.
Ultimately, it is not a deal breaker! It is just development, I can still test apps and pages, just have to do some manual URL hunting. Just curious if this is really a port problem or a problem with PHP built in server.
thanks
Related
I was writing some PHP code for my web application recently. I was trying to test sending an e-mail from a contact form on a local server (by using a variety of methods, including SendMail). None of them worked (though it may be code-related but I don't know yet). I basically restarted Apache/MySQL several times throughout testing. At one point when I was changing the configurations for SendMail, I was unable to re-start Apache & MySQL after stopping them. The icon remained red. Every time I try to start Apache, nothing would happen and the icon still remains red. I tried doing it manually from Services but it's giving me an error. It has always worked in the past, so I am not sure what's happening now or whether or not changing some of the SMTP configurations on php.ini or sendmail.ini and installing these mail server tools messed something up?
Anyone have any suggestions on how to fix/troubleshoot this? I am pretty new to server-side development. I appreciate the help!
It could be a hundred different things, do what welshGaz said and check your logs. If you're still stuck after that, you have the following options:
Uninstall/Reinstall WAMP
Try an alternative to WAMP such as XAMPP
Spin up a virtual environment using virtual box and ubuntu
Spin up a server on Amazon Web Services, Heroku, etc.
These are options are of the last-resort variety, but if you're in a pinch and don't have time to troubleshoot, one of these options might be a faster way to get back up and running.
I think the first place to go would be the WAMP logs. On Windows these can be found under the root_application_install_directory/logs. For example on my Windows 10 machine I can find them under C:\wamp64\logs.
You should find all logs from Apache, PHP etc. placed here. Having a look at those may help you get closer to the cause of your issue and why the server is not starting.
I have a VPS with Plesk that has a nginx+apache setup.
The problem: REMOTE_HOST php $_SERVER environment value contains the domain name of the website, instead of the client's host name.
I've enabled "HostnameLookups On" in apache2.conf (= httpd.conf).
However, because nginx is in between the client and Apache, it seems it's not properly setting REMOTE_HOST. If I connect directly to the php page through the Apache port, the REMOTE_HOST variable is set correctly!
Does anyone have a clue? Been trying to figure it out for hours and nothing seems to work.
I need it to work, because eventually I want to deny from host names in .htaccess.
you should rather consider to use Fail2Ban, when you have Plesk installed on your server, because you seem to miss the fact, that your ".htaccess" - file will be completely ignored by nginx.
Pls. consider as well to include MORE informations about your current Plesk version and the operating system on your server, if you desire more help and keep in mind, that the Plesk Community forum offers quite a lot of suggestions and work - arounds for Plesk and it's components and as well for the possible extensions: => https://talk.plesk.com
I have a php admin panel for a voip client I'm using (https://github.com/dieonar/MyMumb-Panel) running on a Raspi2 with Apache2 on it.
I'm kind of new to hosting but I mainly want to use it on my local net, and thus writing 192.168.0.111/MyMumb-Panel (rasp pi local address) would direct me to this site.
However, while 192...111/index.html works fine, going to /MyMumb-Panel/index.php shows a blank page. I havent written the php module personally but I'm fairly sure it should work OOB..
I have low knowledge of apache and usually use WAMP, but sicne this is on linux, I'm confused with what inis to configure and so on..
Can someone give me pointers as to where to begin ? There's a readme on the git with instructions, which I've followed, but there's some confusion regarding Vhosts and configuring these..
I installed Apache, PHP and Apache to be used with PHP. The Apache server was never pointing to localhost, and the localhost always pointed to IIS instead of Apache.
Interestingly, I had a seperate website (explicitly named with somename.com, running locally with default port 80 and upon firing the Apache server the site was being used (instead of localhost) for displaying the Apache-based folders.
However, both are not able to process PHP and I've been trying to get this to work for almost a day now (I thought it wouldn't be too rough on me initially)
So since no matter what change I've made:
Apache configuration to use specific IP, rather than port 80.
Restricted IIS on specific ports, rather than port 80 and all local ports.
Disabled IIS via 'Services' in Administrative Tools.
Forced restart of 'Apache Service' via 'Services' in Administrative Tools (this threw an error). But restarting it via the Apache Http server menu options seemed to work fine.
Installed XAMPP so it will run directly (not sure if I'm using this wrong though, it did seem to start up but again localhost was never pointing to the Apache's 'htdocs' like it's supposed to.
PHP was added to Apache as well as downloaded (both .MSI, .ZIP installed for BOTH Apache and IIS).
No option seems to make the PHP process, it just displays the source code (like in HTML you have the html, head, body tags displayed on the web site instead of actual HTML ). It's pretty frustrating that:
After different attempts to disable IIS, I've not been able to.
Apache has everything configured to run PHP (I have actually done this on a Macbook once a long time back, don't remember if I missed anything though) but it doesn't work.
No errors are thrown, except that localhost is not displayed (I stopped the sites that were on IIS, and localhost points to IIS, any attempts at accessing either the IIS specific folders, or the Apache sites are not working).
Also, several attempts of getting PHP to work on WINDOWS 7 (yes in capital letters) has failed as well. Please help!!! Let me know if any specific details may help in troubleshooting, and I will be glad to provide them.
Well, firstly, apache is obviously now running as you can see the php source.
If you only see php source, assuming the PHP file is of a .php extension, you can boil it down to almost certainly the mime type hasnt been set.
in your apache config there will be lines such as:
AddType application/x-httpd-php .php
if not, add it.
If that doesnt work it would really seem it hasnt heard of PHP at all.
having not got apache on win7 to hand, theres probably a loadmodule line missing, while this is aimed at vista, this may have some ideas.
http://www.wikihow.com/Install-and-Configure-Php-5.2.5-and-Apache-2.2.8-in-Windows-Vista
Just use some prebuilt solution....
I use WAMP, But there are loads out there.
I am strictly a LAMP dev but an ad agency I work with is courting a government agency whose RFP requires that their site be delivered via a Windows server.
What advice do folks have on this? Are there specific pitfalls? It seems like I have heard that file uploads and folder permissions are very different on Windows servers.
Any advice would be greatly appreciated.
IME, IIS can behave very oddly at times.
The permissions model is primarily ACL based - so its certainly possible to design a system which mimics the way Unix works - but (just as with Unix) get the permissions model right - and don't tinker with permissions / ownership in your code.
And of course you'll get yourself tied in knots if you try to move up directory hierarchies and cross over 'drives'.
Add to that a complete absence of the services you might invoke via popen(), and the POSIX tools.
Yes, people keep telling me its a nice place to visit but I wouldn't want to live there.
OTOH, a self-contained set of PHP files will run quite happily there.
PHP on a windows server is definitely trying on your patience. Problems that I've run into are making sure that IIS is configured to use the correct php.ini file, and as you said, writing to files on the server as well as folder permissions.
That being said, if you can get it working correctly, it's not a bad production environment.
I would suggest getting your dev environment as similar as possible to what production will look like. That way you run into as few problems as possible when you deploy.
I can see some pitfalls for using PHP on IIS
Since IIS is multithreaded unlike
linux which is multiprocess. Some
PHP scripts might be unsafe.
Because of this PHP should be installed and
run as a CGI extension. CGI is
slower than IIS's ISAPI and worse
when compared to Apache's mod_php.
Another pitfall I can think of is URL rewriting. IIS, versions below
v7 do not support url rewriting.
Configuration of PHP with IIS is really a pain. But when you do configure it, make sure you use the same configuration, exact mirror images everywhere you are developing because a lot can go wrong with just one glitch.