How to get Sublime Linter shows PHP errors when i do not have PHP installed on my local machine. I am using Vagrant for development and PHP is installed there.
Thanks
you can still install the plugin
on mac do brew install homebrew/php/phplint or see the download page
Related
After upgrading from 7.3 to 7.4 using brew in OSX Catalina, the PHP Server extension in VS Code no longer works. Selecting "PHP SERVER: Serve Project' just shows the php code in the browser as a text file. It no longer starts the PHP server.
I followed these instructions:
brew install php#7.4
brew link --force --overwrite php#7.4
brew services start php#7.4
export PATH="/usr/local/opt/php#7.4/bin:$PATH"
export PATH="/usr/local/opt/php#7.4/sbin:$PATH"
Upon completion, the command "php -v" in the terminal gave the correct version, 7.4. I don't know how to set PHP Server to use the upgrade? Adding the following paths (determined from running "which php" and "php -ini" in the terminal) to vscode's settings.json didn't fix the situation:
"phpserver.phpConfigPath": "/usr/local/etc/php/7.4/php.ini",
"phpserver.phpPath": "/usr/local/opt/php#7.4/bin/php",
Once I uninstalled running "brew uninstall php#7.4", the PHP Server worked again. I would like to be able to use PHP 7.4. Any suggestions are appreciated.
To remedy the situation, I switched to using XAMPP as my php server, with my Vscode workspace moved to XAMPP's htdocs folder.
I also switched from using the Vscode "PHP Server" extension to the "Open PHP/HTML/JS in Browser" extension, setting the extension's "Document Root Folder" setting to "/Applications/XAMPP/xamppfiles/htdocs" (without quotes), so I can just right-click on an php page in Vscode and open it in the browser, as I did with PHP Server.
So that my php pages autoload on change, I am using the browser "Live Server" plugin (requires the vscode Live Server extension) with the Actual Server Address set to "http://localhost", and VS Code's Live Server Address set to the default "http://127.0.0.1:5500/" (found by clicking on "Go Live' in the lower right of Vscode).
In conclusion for php with Vscode, I am now using XAMPP, "Open PHP/HTML/JS in Browser" extension, and the browser "Live Server" plugin.
Using Laravel with DDEV/Docker on a Mac, I am stuck getting PhpStorm to run directly PHPUnit with coverage. I am following these instructions: https://ddev.readthedocs.io/en/stable/users/topics/phpstorm/
I started the setup with
curl -s "https://laravel.build/myproject?with=mysql,redis,memcached" | bash
Everything's is working fine, including debugging with Xdebug after I turned on Xdebug with
ddev xdebug on
PHPUnit works fine via console as well:
ddev exec phpunit
Composer version is 2.1.4.
Following the instructions named above, I am stuck at point 6.
What am I missing out? PHPUnit is located within the directory and it is composer-installed as well:
With composer version 2.2 the phpunit executable in vendor/bin is not a symlink anymore. It‘s a PHP file which includes the original executable with help of stream-wrapper, but including phpunit is not allowed: https://github.com/sebastianbergmann/phpunit/issues/4096#issuecomment-585900398
The bug is solved in composer:
https://github.com/composer/composer/issues/10387#issuecomment-1000246631
Use the following to get the latest dev version until this fix was official released:
composer self-update --snapshot
Further you can configure PhpStorm to use the original file instead:
vendor/phpunit/phpunit/phpunit
Thanks to all of you guys, I really appreciate your help.
Here is how I solved it:
I installed ddev-edge to avoid composer 2.1.x. I could not change it to 2.2 in config.yaml without failing ddev to restart when using stable version of ddev. It only worked on an active docker instance.
Then configurated ddev to use latest PHP-version 8.1 (for a new project from scratch, it makes sense anyway).
Then the error with PHPUnit changed to an error telling me that the PHP version is too old for the PHPUnit version. That was because PHPStorm automatically picked PHP 7.4 as default when connecting to Docker and checking the CLI remote interpreter.
So I changed the PHP executable from "php" to "php8.1"
See screenshots.
Now running PHPUnit from PHPStorm works fine, even with coverage.
I have read How to enable PHP's openssl extension to install Composer? and You must enable the openssl extension to download files via https
They both state that the php file needs to uncomment extension=php_openssl.dll from the php.ini files which live in both these folders:
C:\wamp64\bin\apache\apache2.4.17
C:\wamp64\bin\php\php7.0.0
C:\wamp64\bin\php\php5.6.16 ' I don't think I need to, but did it any way
I've done that, and then restarted the PC.
WAMP is running on my Windows 10 machine
The same error always shows when trying to install Composer
Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:
The openssl extension is missing, which means that secure HTTPS transfers are impossible.
If possible you should enable it or recompile php with --with-openssl
What do I need to do to install Composer?
Edit
From C:\PHP (the PHP folder) I started a command prompt and ran php -r "phpinfo();"
In the results, there is the following:
OpenSSL support => disabled (install ext/openssl)
I have followed http://php.net/manual/en/faq.installation.php#faq.installation.addtopath
You have multiple version of PHP installed:
C:\wamp64\bin\php\php7.0.0
C:\wamp64\bin\php\php5.6.16
C:\PHP
The PHP version, which you run on the CLI is based on your environment PATH variable. The first PHP path wins.
run php --ini on the CLI. It will show you which php.ini is included and also the path of PHP
edit this php.ini file and activate the extension=php_openssl.dll
then run php -m to check, if the extension is loaded
then run composer
A new version of a program written in the PHP in XAMPP install I had trouble in error openssl.dll, curl_reset () to install the new version of PHP 5.5, how can I fix PHP XAMPP folder with the new version will replace
The easiest way to install the new version of the program, may not install the new version with the error encountered port 80 by performing the following steps, you can download it and trouble-free installation...
download new xampp apachefriends
install it
remove all VPN app
open folder XAMPP run setup_xampp.bat
run xampp-control.exe Or apache-shutdown
I have problems when trying to update laravel 4.1 to 4.2.
I started that project on ubuntu, then got a new macbook pro and it looks like I'm missing something.
I'm using XAMPP 1.8.3
When I
composer update
I get the following error
Mcrypt PHP extension required.
Script php artisan clear-compiled handling the post-update-cmd event returned with an error
After few googling, found homebrew, then it's easy
brew install mcrypt
but I get the following warning
Warning: mcrypt-2.6.8 already installed
Any ideas?
Assuming your macbook pro is running Mavericks, the problem is most likely in your $PATH variable. The php command defaults to the built in php that ships with your mac. You can verify this by entering in terminal echo $PATH;
If it points to /usr/bin:/bin/usr/bin:/usr/local/bin then the problem is here because the native mac php does not include mcrypt. Add your XAMP PHP to your paths variable should solve the problem,
export PATH=$PATH:\path\to\xamp\bin\php5.ver\bin