Execute export command in windows - php

Hello I am trying to execute this command:
export PATH="$HOME/.composer/vendor/bin:$PATH"
in windows.

Please, check these notes
Note: For the local PHP environment I am using a Mac and Valet because it automatically sets up everything. If you are on Windows, you should consider Homestead or some flavor of a virtual machine.

Related

VS Code unable to use PHP Intellsense

I want to use PHP IntelliSense while using WSL environment but VScode is unable to find PHP path. What I should do fix this? I searched for some info but I only see scripts but none worked for me.
Try bash -c "php". WSL exposes a bash.exe binary on Windows, and if everything is correct it will already be in the environment variables, just by invoking it as bash - At least here, where I am using WSL2 with Ubuntu 20.04.
You try also, wsl -- "php" or wsl --exec "php".
UPDATE: Forget what I said above !!
Use the Remote - WSL extension . I believe you're already using it.
Add the following directive to the settings.json file:
"php.validate.executablePath":"php"
the php binary must be properly available in $PATH on the Linux side.
And on Windows you need to have the path of the php windows version binary in the system environment variables, so that when you happen to be editing PHP files in the Windows File System - Not using the WSL remote - it uses the same binary.
This way you will have a VSCode that, when you are remote in WSL will use the proper lecture, being the same for when you are in Windows.
The fix for me was to download php for Windows into the folder c:\php and specify in Visual Studio Code settings.json:
"php.executablePath": "c:\\php\\php.exe",
I also added it to my Windows PATH environment variable.

Changing mac php path to windows xampp php

I am having problem in running php in mac terminal. My scenario is I am using xampp which is actually shared from windows. Now I want to use cakephp bake commands in my mac terminal.How can I do this?
I have tried using export path="/volumes/xampp/bin:$PATH"
But I am unable to do it.
How can I change /usr/bin/php to /volumes/xampp/bin/php?

how can I run mysql if I installed it from MAMP

So I looked at this question Find out where MySQL is installed on Mac OS X
I have MAMP installed and when I run: /Applications/MAMP/Library/bin/mysql --version It gives me correct output for mysql version.
But if I run type -a mysql it says that it wasn't found, as if I don't have mysql installed.
If I want to run mysql from the terminal I can start my MAMP server, then go to MAMP's library and run ./mysql which will start a mysql session.
HOWEVER: I do NOT want to run it using the current MAMP's server I have. i.e Is there a way to run mysql from any directory, like without using MAMP at all?
I downloaded mysql from mysql site http://www.mysql.com and I can run either the one on my MAMP'S server or the one locally on my machine. I just need to decide which of the two since both are running locally.
you should run the daemon manually but you need to setup the data before that by doing something like data directory initialization mysqld

Change PHP path in OS X terminal to XAMPP PHP

I just installed Composer on OS X 10.8 and am now trying to use it to install something else and it turns out my terminal is running php 5.3... In XAMPP I have 5.5, so I would like to just use that version in Terminal as well. I tried creating a .bash_profile in my home directory with
export PATH=/Applications/XAMPP/xamppfiles/bin/php-5.5.11/bin:$PATH
but that wouldn't work; which php still returns /usr/bin/php. What am I missing here? Much thanks in advance.
Here is my working Environment Path
export PATH="/Applications/XAMPP/xamppfiles/bin:$HOME/.composer/vendor/bin:/usr/local/sbin:$PATH"
Remember to wrap the path with double quotes and also close all terminal before checking the php version using
php -v or which php
If you aren't using a bash shell, then changing the bash_profile won't make a difference. bash apparently wasn't always the default, so on my mac, I am using .tcsh. I don't know why it uses one over the other, it has just always been that way (been upgrading macs since OS X 10.0). So on mine I have a .tcshrc file which operates like the bash_profile. In there I have
alias php /Applications/MAMP/bin/php/php5.6.7/bin/php
which you would obviously have to adjust to your own path and version, but you get the point.

How to run mysql commands from terminal on a MAMP install?

I just installed mamp (xampp) from the mamp.info page and it is working on my mac (both apache, php, phpmyadmin, and mysql). The only problem is when i try to run
mysql -u root -p
Which connects to mamp from the mac os terminal, i get a command error. I have installed and uninstalled mamp and xampp for mac multiple times to no avail.
I am following this tutorial; http://www.raywenderlich.com/2941/how-to-write-a-simple-phpmysql-web-service-for-an-ios-app and i can't get past a certain part because i don't want to use php admin, and i think it'd be cool to use it from the terminal.
My question; how do i configure mamp or xampp for mac to work from the terminal?
Put this at the end of your .bash_profile script (create it if it doesn't already exist):
export PATH=$PATH:/Applications/MAMP/Library/bin

Categories