How can i setup Drush to use a proxy server to access internet on Windows7? - drupal

i am using WAMP for Drupal development. I have installed drush and it works fine when using home network without any proxy. When i am at work, the network setting uses a proxy to access internet and hence any drush command which need internet, eg. drush dl {module_name}, doesn't work.
After googling i could only find texts that told me how to configure them on *nix based OS. I'm stuck with windows7. Any idea?

Okay. I got it running. I had to do the following change to make drush dl work on windows 7. Apparently "which wget" wasnt returning anything as windows doesn't have a 'which' command. I hacked the drush core to do the following changes.
Go to file drush.inc in folder C:\ProgramData\Drush\includes
Change the line $use_wget = drush_shell_exec('which wget'); with $use_wget = drush_shell_exec('where wget');
Root Cause:Windows doesn’t have 'which' command, 'where' command serves the purpose
I think there was no issue with proxy at all and it was using proxy from drupal's settings.php file correctly

Related

Curl error 7 when installing apps on nextcloud

Hey this is my first question on here, so go easy.
I set up a Nextcloud server on my homelab in an ubuntu server 20.04 vm using the snap install. I have a seperate vm running nginx as a reverse proxy to my Nextcloud instance. Everything works flawlessly as intended, except that when I try and install apps on Nextcloud, I get a curl error #7. I've tried using my lan ip through the web ui, my public domain name through the web ui, and the commandline using the nextcloud.occ app:install command. I always get the same error. I tried to find the appropriate log file to get more information but looking in /var/snap/nextcloud/current/log/ I couldn't find any relevant info in any of the logs. Running php -m comes up with php not installed, I guess because php is installed via the Nextcloud snap? Obviously php is installed somewhere because Nextcloud is running, but I don't know how to look and see what modules are enabled, or how to install new ones using the snap. Any help on what to do is much appreciated!
enter image description here
Update: I fixed it. I think I had improperly configured my firewall, and turning it off (in proxmox)/making some changes to my /etc/netplan/*.yaml file to properly configure the static IP fixed it. GL
Another reason can be a wrongliy configured network. I forgot to set the gateway/proxy for IPv4, so github.com was unreachable. Most other services I use seem to resolve IPv6 first, so I did not have any other problems besides updating nextcloud apps.

I am unable to vagrant up

I am using a file from GitHub
It has a vagrant file with it. When I run vagrant up command in my terminal, I get an error.
The terminal should show READ ABOVE message when successful download
I want to type in the address to the site on my browser to start a local development server.
Its pretty old file and the repo was using puphpet but this project seems dead for 2 years, the website is down.
In your case, vagrant is trying to download the box from internet but the owner of this box hosted it under the puphpet domain not available anymore
I am not sure what's the best way to help now:
find another more recent example and start from there
if you want to fix this, you will need https://github.com/LearnWebCode/vagrant-lamp/blob/master/puphpet/config.yaml#L6 and use a different box available on vagrant site, ubuntu 16.04 is pretty old now but you can search one from vagrant box

How to see what web server is running on my mac?

I'm trying to learn how to create a custom WordPress theme. I've been following a tutorial, and I was trying to install DesktopServer onto my MacBook Pro (to create a local environment.)
But I'm not able to install it because it's stating that
"It appears that you have another web server already running. DesktopServer cannot be installed. Check that you do not have Web Sharing turned on from your System Preference -> Sharing control panel or turn off and remove your other web server."
I've checked my Sharing settings, and nothing is enabled (including internet sharing.) So that must mean I have a web server already running. But I don't know what that would be.
Is there a way for me to find out what web server my mac is running?
And after that, is there a way for me to disable that so I could possibly use DesktopServer instead.
I've really good with writing HTML, CSS, Javascript, etc., but I'm pretty new to the server and hosting and stuff. I honestly don't understand everything yet.
I had the same problem, and the solution that worked for me was here:
https://zachgoll.github.io/blog/2018/serverpress-error/
By default, Mac OSX has an Apache server running in the background
which conflicts with Serverpress by default.
To turn it off, run sudo apachectl stop.

How to deploy WordPress with Capistrano on shared host without sudo

In the pursuit of a more professional WordPress dev and deployment environment I am trying to use Capistrano to deploy from my local dev environment to staging and production servers but I can't quite get it to work.
I am on Site5 shared hosting and am deploying to one server with two different domains - staging.example.com and example.com.
I have used https://github.com/markjaquith/WP-Stack as a basis and have added
set :user, "myserveruser" to my config.rb file as the connection didn't work without that.
Running cap deploy:checktells me "You appear to have all necessary dependencies installed" and I can run cap deploy:setup which successfully connects to staging and production creating releases and shared directories etc.
The problem comes when I run cap deploy. Everything seams to work fine until I am prompted for a sudo password. This is not a normal login prompt though and does not allow me to type a password. As I am on a shared host I don't have sudo access anyway.
Its similar to this problem Capistrano is hanging when prompting for SUDO password to an Ubuntu box but the solutions didn't fix all my issues.
I have set default_run_options[:pty] = true which I seam to need but still get the sudo prompt.
I am using passwordless ssh so Capistrano is able to connect and do everything it needs to do without prompting for a password and I am also using an SSH config file to handel agent forwarding so the server can also connect to my git repository. I have confirmed this is working.
I have found other people having similar problems - Capistrano using sudo even with "set :use_sudo, false" - etc but none of the solutions have worked.
I am using default_run_options[:pty] = true and have tried using set :use_sudo, false and default_run_options[:shell] = false but I still have the same issue.
You can view my Terminal output here - http://pastebin.com/5xZmCnyA
I am seriously going crazy! Any help would be greatly appreciated!!!
Cheers
You can't run setup without sudo. That's the only part that REQUIRES sudo, because it makes a directory public_html/staging.exposecreative.org, in your case...
That step shouldn't be required, you can make that directory yourself (assuming you have permission)..
The problem you will face however is that the shared host will expect your index.php to be directly in public_html, for that to work you'd need write permission to whatever directory public_html is in, which your shared host won't allow (almost certainly)
The line default_run_options[:pty] = true has to do with whether Capistrano pretends to be an interactive shell or not. Many commands (sudo included) use this to determine if they should bother asking the user for input, or if they are part of an automated process (
in which case there's no way to ask for input)
My advice (as Capistrano maintainer) - don't try this on a shared host, it almost certainly won't work. (Sorry, their limitations, not ours)
I wrote an extensive post on how to deploy WordPress with Capistrano on a shared host (Bluehost). I use the Roots/Bedrock stack and it only took me about 20 minutes to get up and running.
I made a WordPress development stack using Shipit JS instead of Capistrano because I'm not comfortable with Ruby. Maybe that can help. Feel free to use it and/or post some issues if needed. Regards.
WP-Jungle / Bonzai

xampp apache not running

I want to install wordpress on localhost
I have downloaded and installed XAMPP.
I have downloaded the wordpress 3.4.1 and placed it in htdocs folder.and i renamed it as demo_folder.
when i type in navigation bar localhost/demo_folder it shows Unable to connect page.
As you can see the apache is not running as shown in fig.
when i click on start it doesnt get started
I dont know why?
can anyone help me out???
EDIT1
the below is netstat -an cmd screenshot
This is a fairly common problem with XAMPP/Windows. The usual suspect is that there is another application running on port 80, which you should terminate. Also please use the web, there is a wealth of information on this topic.
To view all currently open ports and the PID of the process using that port, open cmd and run
> netstat -o
This should help with changing the port Apache runs on: http://www.geckoandfly.com/7491/xampp-apache-wont-start-change-port-to-listen-85/ .
If you're on Windows 7, shut down the Web Deployment Agent Service. That should clear port 80.
XAMPP does have some problems with Windows. You could also try using WAMP. It seems to be a lot easier to install and use.
As for XAMPP, try making sure nothing else is using the port 80.
It seems you have tried to install the XAMP multiple times or PORT 80 has been used by other Application. If you are sure other applications is not using the Port 80 try this:
Close the XAMP and go to run and type services.msc and find the service named Apache 2.x.x etc go to its properties and get the exact name of it . For eg, mysql service name is mysql.
After you have found the service name , Open cmd with administrator privilege and type
sc delete apache
here is the manual to delete the service name :
http://technet.microsoft.com/en-us/library/cc742045(v=ws.10).aspx
after deleting the service name try opening the XAMP and click on Start next to Apache, hope it will be running now.
If nothing works above ,most of the cases I have seen Skype is the problem:
Go to Tools>Options>Advanced>Connections
Untick Use Port 80 for incoming connections

Resources