I'm trying to move a laravel project to a remote server.
I just copy the folder on the public/html folder, then I've tried to install composer as described here:
https://getcomposer.org/download/
with the very first command I've seen this error:
/federlegno$ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
PHP Warning: copy(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in Command line code on line 1
PHP Warning: copy(): Failed to enable crypto in Command line code on line 1
PHP Warning: copy(https://getcomposer.org/installer): failed to open stream: operation failed in Command line code on line 1
as solution I find to run the command without the https: php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
and then it seems thats the others command works, without promt any error (I've tried even to visit the link with the browser and it works!).
Then when I try to run:
composer install
inside the laravel folder this error is raised:
bash: composer: command not found
Some additional information:
/federlegno$ php -r "phpinfo();" | grep OpenSSL SSL Version =>
OpenSSL/1.0.2r OpenSSL support => enabled OpenSSL Library Version =>
OpenSSL 1.1.0j 20 Nov 2018 OpenSSL Header Version => OpenSSL 1.1.1a
20 Nov 2018 Native OpenSSL support => enabled
php version:
ederlegno$ php -v PHP
7.2.15-1+0~20190209065123.16+stretch~1.gbp3ad8c0 (cli) (built: Feb 9 2019 06:51:24) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.15-1+0~20190209065123.16+stretch~1.gbp3ad8c0, Copyright (c) 1999-2018, by Zend Technologies
Laravel version 5.4
You should move the composer.phar file (which is downloaded by the installation scripts) to the /usr/local/bin or /usr/bin directory
sudo mv composer.phar /usr/local/bin/composer
or
sudo mv composer.phar /usr/bin/composer
I am attempting to add the ZeroMQ extension's PHP functionality to my local server. I have successfully installed it however binding it to the PHP of my system has been a challenge.
I've attempted both the PEAR/PECL and Github building methods however they all come down to this CLI Error:
In file included from /private/tmp/pear/install/zmq/zmq.c:31:
/private/tmp/pear/install/zmq/php_zmq.h:45:10: fatal error: 'php.h' file not found
#include "php.h"
^~~~~~~
1 error generated.
make: *** [zmq.lo] Error 1
ERROR: `make' failed
where can I generate and include this php.h file?
php-v shows: PHP 7.1.7 (cli) (built: Jul 15 2017 18:08:09) ( NTS )
phpize -v shows: grep: /usr/include/php/main/php.h: No such file or directory
grep: /usr/include/php/Zend/zend_modules.h: No such file or directory
grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
I ran into this when installing zmq on MacOS 10.14.3 Mojave. I'd done the followings and it's fixed.
install the command line tools if you haven't done so.
xcode-select --install
install the header files
cd /Library/Developer/CommandLineTools/Packages/
open macOS_SDK_headers_for_macOS_10.14.pkg
Credit to #Steven Installing xdebug on MacOs Mojave - 'php.h' file not found
I need to setup vfsStream to use it with PHPUnit on my env. Unfortunately the project is very old and I cannot use composer. Instead I tried to install it using pear acording to documentation. Bovigo channel is discovered properly but when I try to install vfs I get following stack trace:
[vagrant#dev site]$ pear install bovigo/vfsStream-beta
Warning: lstat(): Lstat failed for /var/cache/php-pear/ea87df910d5f186e8b68f01fb94241bcrest.cacheid in PEAR/REST.php on line 276
PHP Warning: lstat(): Lstat failed for /var/cache/php-pear/ea87df910d5f186e8b68f01fb94241bcrest.cacheid in /usr/share/pear/PEAR/REST.php on line 276
PHP Stack trace:
PHP 1. {main}() /usr/share/pear/pearcmd.php:0
PHP 2. PEAR_Command_Common->run() /usr/share/pear/pearcmd.php:305
PHP 3. PEAR_Command_Install->doInstall() /usr/share/pear/PEAR/Command/Common.php:271
PHP 4. PEAR_Downloader->download() /usr/share/pear/PEAR/Command/Install.php:661
PHP 5. PEAR_Downloader_Package->initialize() /usr/share/pear/PEAR/Downloader.php:279
PHP 6. PEAR_Downloader_Package->_fromString() /usr/share/pear/PEAR/Downloader/Package.php:190
PHP 7. PEAR_Downloader->_getPackageDownloadUrl() /usr/share/pear/PEAR/Downloader/Package.php:1713
PHP 8. PEAR_REST_13->getDownloadURL() /usr/share/pear/PEAR/Downloader.php:850
PHP 9. PEAR_REST->retrieveData() /usr/share/pear/PEAR/REST/13.php:68
PHP 10. PEAR_REST->saveCache() /usr/share/pear/PEAR/REST.php:163
PHP 11. PEAR_REST->saveCacheFile() /usr/share/pear/PEAR/REST.php:246
PHP 12. lstat() /usr/share/pear/PEAR/REST.php:276
No releases available for package "pear.bovigo.org/vfsStream"
install failed
It looks like you might need to do that via sudo, e.g.
$ sudo pear ....
I have had to re-install / update Cygwin on Windows 8.1, and I have some how broken Drush on my Drupal 7 sites.
Previously I followed this guide Here So I have tried to do a clean install of drush, and noticed that you can now install drush via pear.
pear channel-discover pear.drush.org
pear install drush/drush
So in my home directory :
$ drush --version
Drush Version : 6.2.0
That seems to work, but when I go into my directory where my Drupal web site is, I am getting PHP fatal errors, it is like the PATH or something is broken when I run drush from there :
$ cd /cygdrive/c/websites/www.mywebsite.com
$ drush
require_once(c:/websites/www.mywebsite.com/modules/system/system.module): failed to open stream: No such file or directory drupal.inc:21 [warning]
PHP Fatal error: require_once(): Failed opening required 'c:/websites/www.mywebsite.com/modules/system/system.module' (include_path='.:/usr/share/pear') in /usr/share/pear/drush/includes/drupal.inc on line 21
require_once(c:/websites/www.mywebsite.com/modules/system/system.module): failed to open stream: No such file or directory drupal.inc:21 [warning]
PHP Fatal error: require_once(): Failed opening required 'c:/websites/www.mywebsite.com/modules/system/system.module' (include_path='.:/usr/share/pear') in /usr/share/pear/drush/includes/drupal.inc on line 21
My Current set up is :
Windows 8.1
Cygwin
Drupal 7
For PHP I am using WAMP, but PHP is working in Cygwin
.
$ php -v
PHP 5.5.16 (cli) (built: Aug 24 2014 01:12:58)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
When using Cygwin's version of PHP, the "require" statement does not recognize path names which start with a drive letter. Thus require 'C:\path-to-file' will generally fail. Internally, it sees the 'C:' as a relative path and appends it to the default directory rather than treating it as an absolute path.
If you rewrite the require statements to use __DIR__, then things usually work.
require __DIR__ . '/modules/system/system.module';
i'm working with ubuntu 11.10 as root on my local machine, i've installed xampp 1.7.7 and i'm a newbie to ubuntu,
while following a tutorial on sitepoint(http://www.sitepoint.com/getting-started-with-pear/) on how to install pear to use PhpUnit, i didnt notice it then, but it seems that i installed or used an existing php version 5.3.6 in CL to do that, also the pear installation was built on this version, while xampp being installed,i now have two versions of php,xampp's 5.3.8 and the 5.3.6, anyway, what i want to do is to use the existing xampp php version and build pear on that, to make all my work through xampp.so my questions are:
how to uninstall the php V5.3.6 and it's pear installation?
how to link the CL with the php ver. of xampp?
how to build the next pear installation on the php ver. of xampp?
i want all my web dev. work through xampp, is there anything else i need to unistall, to avoid this confusion? 4.
i did the following in attampet to solve the problem:
i wrote this in bash:
gedit ~/.bashrc
i added that to the end of ~/.bashrc file in attempt to change environment path:
export PATH=/opt/lampp/bin:$PATH
export PATH=/opt/lampp/lib/php:$PATH
export PATH=/opt/lampp/lib/php/PHPUnit/pearcmd.php:$PATH
i checked the php and pear version using 'php -v' and 'pear list'
i got an ouput of:
PHP 5.3.8 (cli) (built: Sep 19 2011 13:29:27)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
and for pear:
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.9 stable
Console_Getopt 1.3.1 stable
PEAR 1.9.4 stable
PHPUnit 1.3.2 stable
Structures_Graph 1.0.4 stable
XML_Util 1.2.1 stable
when i run: 'phpunit MessageTest.php': i get
PHP Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 38
Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 38
PHP Fatal error: require_once(): Failed opening required 'PHP/CodeCoverage/Filter.php' (include_path='.:/php/includes:/opt/lampp/lib/php:/opt/lampp/bin:/opt/lampp/lib/php/PEAR') in /usr/bin/phpunit on line 38
5.i ran the following commands as reported in other questions as a solution to that error:
sudo apt-get remove phpunit
sudo pear channel-discover pear.phpunit.de
sudo pear channel-discover pear.symfony-project.com
sudo pear channel-discover components.ez.no
sudo pear update-channels
sudo pear upgrade-all
sudo pear install --alldeps phpunit/PHPUnit
sudo apt-get install phpunit
and updated include path of php.ini to be:
include_path = ".:/php/includes:/opt/lampp/lib/php:/opt/lampp/bin:/opt/lampp/lib/php/PEAR"
the php file MessageTest.php:
<?php
require 'PHPUnit/Autoload.php';
$path = '/opt/lampp/lib/php/PEAR';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
require_once 'PHPUnit/Framework/TestCase.php';
require_once 'Message/Controller/MessageController.php';
class MessageTest extends PHPUnit_Framework_TestCase{
private $message;
public function setUp() {
$this->message = new MessageController();
}
public function tearDown() {
}
public function testRepeat(){
$yell = "Hello, Any One Out There?";
$this->message->repeat($yell); //sending a request
$returnedMessage = $this->message->repeat($yell);//get a response
$this->assertEquals($returnedMessage, $yell);
}
}
?>
MessageController class from MessageController.php that i'm trying to test
<?php
class MessageController {
public function actionHelloWorld() {
echo 'helloWorld';
}
public function repeat($inputString){
return $inputString;
}
}
$msg = new MessageController;
?>
I'm not using any PHP framework, i just made the files and classes sounds like it that's all.
and still i get the same error:
PHP Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line
Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 38
PHP Fatal error: require_once(): Failed opening required 'PHP/CodeCoverage/Filter.php' (include_path='.:/php/includes:/opt/lampp/lib/php:/opt/lampp/bin:/opt/lampp/lib/php/PEAR') in /usr/bin/phpunit on line 38
sure, i'm getting demanding here, i've wasted a lot of time and got really frustrated over this, hope you guys dont get bored reading through my questions, i appreciate your help
thanks in advance,
Mohamad elbialy
Finally, i got the answer for the question on how to link the xampp's php and pear to CL (bash shell for ubuntu),
type the following in a terminal window:
gedit ~/.bashrc
the file opens and you add the following to the end of file:
export PATH=/opt/lampp/bin:$PATH
and to make sure type the following in the terminal:
echo $PATH
you'll see '/opt/lampp/bin' in the echoed path along with others added by default
this is the only way that worked for me after 2-3 days of searching forums, other stackoverflow and superuser questions
to check that the CL is dealing with xampp's php and pear version, type the following:
php -v shows the version of php
pear list shows the version of pear along with pear dependent packages
Now, i've been doing this to make PHPunit work in CL, for 5 days, imagine the frustration,
being a newbie to Ubuntu i made alot of sudo and not so sudo commands that missed the whole thing for me, so i decided to make a fresh installation of ubuntu (to delete all those pear, php and phpunit packages that i installed and couldnt track thier path)
so starting from a fresh ubuntu 11.10 and xampp 1.7.7, i did the following to make phpunit work:
i made the link for xampp's php and pear with cL (i wrote how above),
type the following steps in CL:
sudo /opt/lampp/bin/pear uninstall phpunit (xampp's is 1.2.something, i want to install 3.6.10)
sudo /opt/lampp/bin/pear list (PHPunit is not there, that's a check),
the following steps as advised in PHPunit manual1
sudo /opt/lampp/bin/pear config-set auto_discover 1 (opens the download channel or something)
sudo /opt/lampp/bin/pear install pear.phpunit.de/PHPUnit (this installs ver. 3.6.10),
now type in CL:
sudo /opt/lampp/bin/phpunit --version (this shows the version of 3.6.10, yes you've made it)
i used /opt/lampp/bin/phpunit, to make you see quick results and no, you dont need to include anything in path to work, you already done that, you need to close that terminal and open a new one and type only, phpunit --version, you'll get the same result, it's there, it's all yours
Note:
i used '/opt/lampp/bin/something and then the command', to force my installations through xampp's php and pear, this is not needed (cause you set the environment path), but that's how you get to do things when you spend more than 5 days of search.
i tried working with phpunit 1.2.something of xampp's, but it seems that it's not there for the command line, i dont know why and i dont want to, so if that happens to you and you want ver.1.2.something, find all versions, using the instructions in this link (http://pear.phpunit.de/) and do the same steps to install it,
i didnt try the method in that link and if you get stuck you can comment to this answer,