I have a php webserver setup running in a remote website; lets call it remote.com
Have the wamp installed in local windows machine ( localhost ) and did the necessary xdebug configuration and netbeans installed. Now my doubts are:
My IP is not static IP but dynamic one. So specifying this in the remote server's php.ini will work?
To debug the php file which resides in the remote server, should I have the same exact copy of source file be available in localhost too? What will happen if there is small changes, lines mismatch etc.
What happens in the background technically?
Thanks in advance.
Related
I have been developing a php project and the wamp server was seems
working fine but suddenly it stops working and i don't know what to do
because when i check its status it says server online and green icon is also
showing but it just does not work whenever i run .php files, Mr. browser
just write it down as i did in notepad++ but before some days it was working
fine, please help me I'm kinda stuck?
I also want to mention that in the mean while I installed tomcat server for some other work is it anything to do with fault because i'm pretty sure both operating on differnet port numbers
use <?php instead of <?or left click wamp > php > settings > short_open_tags
and make sure you are running your scripts through localhost and not just opening the php file in the browser
Read More about wamp problem
If you're definitely viewing the script through your MAMP setup (if your URL bar starts with http:// instead of file://) and it is showing the contents of the PHP file instead of executing the script, it sounds like Apache is running fine, but PHP-FPM is the issue or a misconfiguration between the two. Apache should detect it is a PHP script and ship it to the PHP-FPM process, accept a response then ship it to your browser.
I would recommend checking PHP-FPM logs first. All logs are in MAMP/logs - scroll to the bottom of each one for latest entries. Ensure the service is running as expected and logging hits when Apache serves a .php file. PHP-FPM may be using a socket file (which can hit permission problems) or on a network port (which can be in use/require admin privileges/etc). Otherwise check your config files, or re-install MAMP for fresh config files.
If Apache cannot start, common reasons are;
The port is in use by another application
The port is a low number and you do not have administrator privileges to use that port
Switching from wired to wireless / switching network adapters / changing hostname, etc
Apache is already running, or Apache thinks it is
You must sign out from Skype it'll occupied the port of Apache or you should turn down the server and then restart you pc and turn it on. It will work fine.
We are running nginx on CentOS 6.4 and upgraded the curl packages from 7.19 to 7.41 yesterday and since then cURL no longer checks the hosts file to resolve host names (and so will not connect to xyz.local)
We use cURL via Guzzle and are no longer able to connect to the various services on our local machines.
John Hart posted this answer which is helpful but would require a fairly significant change to how our site (a LOT of legacy code) manages connections for our local and dev environments.
Is it possible to just tell cURL to use the hosts file?
As a workaround you can install a DNS server that reads your hosts file, and use it as system DNS resolver. For example dnsmasq does this by default.
I am running a wamp test/development server on my rig, however I am trying to ensure it replicates the normal behavior of a production server. Last time I moved from a test environment to a live one I had the following issues:
Case sensitive relative paths were being obnoxious on the live server
Case sensitive MySQL commands were being obnoxious on the live server
Some header requests I sent (okay this is embarrassing) in the middle of a 'view' were obviously not getting accepted.
I replicated the behavior of error number 3 on my test server by disabling output_buffer in the ini file.
However, I haven't quiet figured out how to make my test server all touchy about case sensitive paths and sql commands.
Could someone help me out? Also, please point out the other settings I should enable/disable in the ini file to ensure it acts like a live server.
The trouble is that your live server is a non-Windows server, and your test server is a Windows server. PHP is relying on the system to find files. Windows files/paths are not case sensitive.
For everything else, you are likely using different versions of MySQL and what not.
If you want a solid test, either upload directly to your live server, or duplicate the server and run it in a virtual machine, such as VMWare, on your dev computer.
I am new to Windows IIS and I need to run a php/mysql application on it. For local php development on windows, I have found WAMP to be the easiest.
But can WAMP be used in this case instead of installing php and mysql separately ?
This needs to be done on an ec2 Windows 2003 instance. So far, I have already tried installing WAMP and setting up apache to listen on port 8080 instead of 80. From inside the remote desktop, both IIS and WAMP work properly in parallel on their respective ports.
However, when I try to connect from another computer using the ip address http://184.**.***.***, IIS works fine serving the default web page but cannot connect to apache on http://184.**.***.***:8080.
Is it possible to use WAMP at all for this purpose and if yes, would there be any disadvantages in using it instead of installing php/mysql seperately ?
Edit :
I dont know if this is a problem of blocked 8080 port. To verify this I stopped IIS and configured apache to listen to 80. Even then http://184.**.***.*** doent show the WAMP homepage. IS anything needed to be configured in IIS ?
RESOLVED :
Added the port 80 in Windows Firewall Exceptions and it started working.
Also, its necessary to select "Put Online" in the WAMP tray otherwise it gives a forbidden response as suggested by some answers.
Thanks
I haven't used EC2 in this way before, but broadly speaking, I'd encourage you to use the same server for development and production environments if at all possible - the installation effort can be a bit of a pain, but it's nothing compared to developing an app locally and then finding an IIS configuration issue causes it to break on production.
This approach also lets you keep your PHP configurations in source code control - php.ini and any modules you're using - and automatically deploy them alongside your application; again, forgetting to deploy the correct PHP.ini usually makes your application do crazy things...
So, your choices appear to be:
- switch off IIS and have WAMP listen to port 80. Not sure WAMP is designed for production level traffic, but in the past, I've run low-traffic public websites in this way.
- work out why port 8080 is blocked, and if it can be unblocked. This would still require you to run your website on an unusual port, which makes for ugly and hard-to-communicate URLs.
- install PHP on your IIS instance. One benefit of having installed WAMP is that MySQL should already be up and running, and the basic PHP installation should also be there; getting PHP to run on IIS is no longer a dark art ([http://php.iis.net][1])
For my money, I'd go for the latter option...IIS is a production quality server, and it's clearly what Amazon want you to use in this instance.
Of course, running IIS on your development environment may be a problem.
Have you put the server online? Think it is offline by default, meaning it's only accessible from your local machine. It's an option in the systray menu to put it online.
If I remember well, there is an option "go public" (or "put online") on the system traya icon of wamp.
This option modifies the httpd.conf to authorize public access.
You should give a try.
On a side note, you can make php work with IIS. This is another option to help you manage your server. (Mysql and Php have to be installed separatly but, this is very easy to do as far as I remember :) )
I have downloaded some files which have .php extension.
Then I installed WAMMP server on my, but I am not able to view those files. I have also turned off the IIS from the add/remove windows program. Still, I am not able to view the pages.
I'm presuming that by WAMP, you are using Apache as your server? You need to find your www folder in C:\WAMP\www and place files in there.
Here is the wamp server I use.
http://www.wampserver.com/en/download.php
I have also used this one in the past.
http://www.apachefriends.org/en/xampp.html
Click on the wamp server icon on your taskbar, go to Apache and you will find Test Port 80 in there. That will show whether port 80 is available or not. If not, go to httpd.conf file which is in the Apache menu of wamp server, find line Listen 80. Change 80 to 88. Restart All Services in wamp and that should work. Let me know if that helped.
How are you trying to view the pages? Why exactly are you "not able" to do it? Are you aware that PHP files are basically programs that run on a server, and you view their output using a web browser? Assuming that you have actual PHP files (rather than their output) and all the resources that they need, you will have to put them into the source folder that WAMP is configured to display, and then you will be able to view them by going to http://localhost in your web browser.
in the run put mmc - on the consol file / add /remove item choose internet information service and under website turn off the iis
if you installed in the past wamp/mysql selete all and reinstall only the wamp
Click on the wamp server icon in the taskbar and test "localhost".
If that works, click the "phpinfo()" link on the page.
If that works too, your wamp server is working and you should be able to execute php files.
If not, you need to make sure it is installed properly and started properly.