this is my very first question here, so please be clement.
I have been programming for weeks a web site with both PHP and JAVASCRIPT, and I also use nodeJs with socket.io and express.
When I tested my localhost locally (on a linux Debian), I configured my app.js to work on the port 3000. Thus, there was no conflict between Apache (which is already working on port 80) and NodeJs, and everything worked well.
But since yesterday, I've attempted for the first time to host my website, and of course NodeJs didn't work anymore (I think it's absolutely normal, because only the port 80 is listened, isn't it ?), but the rest of the website still worked.
So, I did some research, and I've found a solution here which deals with proxy on Apache. Unfortunately, since I've done it, my browzer doesn't display my /index.php normally, instead of it, it tries to download index.php as a bin file.
(some precisions : my app.js is configured to work with /game.php, not /index.php, but if I try to access to /game.php it shows : "Cannot GET /game.php")
I'm a little lost, I'm still struggling to search some informations by myself, but I know that I'm lacking knowledges
PS : Before to do this handling of the apache2.conf file, I attempted to "turn" the port 3000 to 80 by modifying /etc/rc.local with iptables, but the same problem returned : the web browzer only wants to DL the /index.php....
Thanks for have read, and sorry for my bad English.
If you want more accurates details, ask me.
Your PHP config is messed up, you can tell any time you download instead of view them in your browser. If I had to guess I'd say that it has something to do with those virtual host blocks you added. Look up how to setup PHP with Apache, or ask your hosting provider for help. With the information you have provided, there is not much we can do for you as your question is not clear.
Related
I have a dynamic website developed by native PHP on a server using NGINX which was functioning normally, but suddenly it broke down such that the PHP files no longer run and just download automatically to the client with the code whole source when he tries to excute that files. I don't know why it happened, and is it because of a hacking or an internal server problem. When I contact the web host, he says that a php file that is causing this problem, knowing that I haven't changed anything at last time.
Please clarify the cause of this problem if you have an idea !! Thank you in advance.
There is no idea yet ? I add that the last time, the host re-initialized the configuration of the VPS, and the website is now running well. It is clear that the problem was in the configuration! But I ask the same question, why did this failure happen? I want to know the reason: if the problem comes from PHP files or from the server itself !!
I have tried everything.
I recently tried to deploy a new Laravel application on my Ubuntu Digital Ocean droplet. I have done this many times in the past and have done nothing out of the ordinary with this project. I'm using https://gist.github.com/jamieshepherd/50419bb148a4f43e8266 this as a template nginx configuration, which I base all of my sites off. However, this time I deployed and went to my domain, I was served another client's site. The site had no images, styles, scripts etc. - but sure enough this was the wrong site. Weirdly, I could go to /images/example.jpg and get the correct file which would be in /public/images/example.jpg - but the actual routes were being served from a completely different folder.
There is absolutely no reference to the other client in my project anywhere, I feel like it has something to do with Laravel or PHP5-FPM setting some kind of root directory to the other folder.
I have gone to /public/index.php and just echo and died a message, and this works fine. When I revert the change and let the application run it again displays the other client's application. Here's a list of other things I've tried.
Temporarily renaming the other client's folder, as expected, NewSite throws a 404 error
Temporarily disabling the other client's nginx block, NewSite continues to serve the other client's site (remember, not css/images/scripts, weirdly)
Reinstalling PHP5-FPM
Printing the document_root, everything looks normal (/web/NewSite/public)
Trying to run the site off a different port
Pulled a working Laravel application from a completely different server, put it on this server, set the domain to point to this working application, serves the other client's site
Grep'd for any references to the client site in any of the project folders just to check I wasn't going insane, confirmed I'm not insane, though after all this I'm not sure anymore
Really I'm lost, I have no idea how to debug this any more.
Site trying to deploy: http://paragon.gg
Client site view that it's servring: https://swellhunter.co.uk
Client site NGINX conf: https://gist.github.com/jamieshepherd/4ff5430ddb13ed04f22c
Edit: Update: To make matters even more bizarre. I have temporarily removed swellhunter from sites-enabled, visited paragon.gg, still serves swellhunter's index. WHAT? There is absolutely no reference to the site at all now, I've even moved the paragongg folder to a completely different place to check. How on earth is it even finding the view with no reference to go on?
Seems like an issue with Laravel rather than with nginx or with your VPS.
Since you pointed out simple PHP file is pointing out rightly.
SSH to your droplet and run you laravel app using php artisan serve.
And access your droplet on port:3000
If the problem persists you can rule out server issues and can concentrate on debugging laravel app. Maybe be there is something wrong with you laravel app itself, some unwanted changes etc. Did you verify your laravel App?
Can you paste an LS -l of the directory? Have you checked to see what you have in the Laravel app/config/app.php for url ? I just took a look at paragon.gg and put https://paragon.gg it gave me a cert error but after I accepted it the site looked fine. Is that not the result you wanted?
I'm starting to get crazy with this.
I have to do some modifications to a wordpress website that i didn't create. I have access to the hosting so I downloaded all the files and a copy of the database.
After creating and importing in the local database I went to wp-config.php and change the hosting parametres (user, pass, server,...) for the local ones.
But here comes the troubles. When I change the online server dbXXXX.db.1and1.com to localhost it suddenly stops working and files called index.php won't ever work again
(I get "localhost server not found" error),
even if I change the source folder, or restart MAMP or restart the laptop... The only solution is to unistall MAMP, restart the system and install it again, but when changing the name of the server to localhost it happens again...
Well... If I copy the content of index.php in another file (for example index2.php) and set the parameters to the online server it works again until I change server to localhost.
When I say "it works" means that at least I get "error database connection" from wordpress (due to the online hosting does not allow external requests to its databases).
Can somebody help? Do you need some extra information? Thanks!
MAMP did some crazy this on my PC to, so I decided to switch to WAMP -
http://www.wampserver.com/en/
You may give it a try ?!
Finally I found the error. It's due to the file ".htaccess" that Wordpress (or I don't know who) creates for using permalink and MAC OS X.
When unzipping the web downloaded from the hosting the OS deleted that file because only system files can start with a dot (".htaccess").
I didn't find the solution and just start to work in Windows with BootCamp and all was fine. I was in a hurry to finish this job so I didn't have more time to try new solutions.
So I have not the solution but the source of the problem. Hope this helps someone at least finding the problem and save some time.
This question has been asked in many forms, and I have spent more than six hours scouring the internet for an answer that solves my problem. So far, I've been unsuccessful. I use MAMP to develop PHP applications, and I upgraded from Snow Leopard to Lion yesterday and immediately my local applications were running much slower. I believe that its a DNS lookup issue around how Lion handles IPv6. I tried the following steps to fix the problem:
Changed all of the entries in my host file to no longer use the .local TLD
Put all of the entries in my host file onto separate lines
Ensured that my host file had the correct encoding
Added IPv6 entries to all local entries in my host file
Installed dnsmasq (may have not done this correctly)
Put all of my host file entries before the fe80::1%lo0 localhost line
This fixed some problems, but there's still one problem that I haven't figured out. In our PHP applications, we define our SOAP endpoints like so:
api:8080/contract/services/SomeService?wsdl
On each server, there is an "api" entry in the host file that points to the IP address for the SOAP API. So, when I want to point to our dev server, I change my hosts file to look like this:
132.93.1.4 api
(not a real IP)
The DNS lookup for the api entry in the host file still takes 5 seconds every time. When I ping api, the result comes back immediately. However, when I ssh api, it takes about 5 seconds before I can connect to the server. This means that when I load up my PHP application, any SOAP query will take 5 seconds + however long the actual query takes, making local development totally impossible. I realize that the way we're defining our endpoint may not be the best design decision, but it's what I have to work with.
From other questions I've read, I believe it's trying to look up "api" in IPv6 first, failing, and then looking in /etc/hosts. I tried using dnsmasq to switch this order, but had no luck. Does anybody know how to force it to read /etc/hosts first, or skip IPv6 altogether?
Update: I changed the entry in the hostfile to api.com, api.foo, anything with a "." in it, and it responded immediately. However, I would still like to find a solution that doesn't require changing the name "api".
I was having the same issues ever since I upgraded my modem which supports IPv6. Adding both host name formats (IPv4 and IPv6) fixed the issue for:
::1 domain.dev # <== localhost on crack
127.0.0.1 domain.dev
I have a standard php app that uses SQL Server as the back-end database. There is a serious delay in response for each page I access. This is my development server, so its not an issue with the live setup, but it is really annoying for working on the system.
I have a 5 - 8 second delay on each page.
I am running SqlServer 2000 Developer Edition on a Virtual Machine (Virtual PC).
I have installed SqlServer on my development machine but get the same delay.
I have isolated the issue to the call to mssql_connect (calling mssql_pconnect has no effect)
It is a networking issue on how I have set up (or not set up, since I didn't really change default config) SQL server. It's not a strictly a programming issue but I thought I might get some valuable feedback here.
Can anyone tell me if there is a trick, specific set of protocols, registry setting, something that will kill this delay?
I was also experiencing a 5-10 second delay on every connect, using the official Microsoft SQL drivers for PHP (as suggested by #gaRex) - none of the answers posted here solved it for me.
As suggested by #ircmaxell, my problem was a DNS issue - and the solution was to edit the \windows\system32\drivers\etc\hosts file (your local local host file) and add the name of my own machine to it.
In the "system properties" dialog, find the "computer name" of your machine - then add a line like 127.0.0.1 my-computer to your local host file.
For me, the delay occurred once more, on the following attempt to load the page - after that, it was super fast, no delay at all.
Note that this problem may occur even on a physical machine, not only on a VM.
I came across network issues when running virtual pc, everything network related is slow, try adding this entry on your registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
Create new DWORD value named DisableTaskOffload and set its value to 1.
Restart the computer.
It worked for me, source.
Is it perhaps a DNS issue? I know that MySQL does a reverse DNS lookup on each login (not each connection). If you don't have a reverse dns record for your server (or your dns is slow) it can cause a major delay at login. There's an option in MySQL to disable that. I'm not sure about SQL Server, but I'd assume it may be doing something similar...
I remember the same problem, but forgot, how we have solve it.
To clarify please specify exact connect strings, your SQLserver versions and also try to start this old good utility c:\WINDOWS\system32\cliconfg.exe, which is also can bring some light.
Yes, I know, it's from 2k, but guys at m$ don't like to create client tools from scratch.
Also try to get "right" mssql client dlls for PHP.