Install october cms with composer on raspbian 8 (raspberry b+) - php

yesterday i started to install raspbian on my raspberry b+ to create a development machine to test October cms.
I install:
apache 2
php - 5.6.14
mysql
phpmyadmin
Then i follow this link to installa october cms:
https://adrianmejias.com/blog/post/october-cms
https://octobercms.com/docs/console/commands
But i have encouter different problems. I installed composer as root then try to create project to pull the october dev-master.
I received this error:
"Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar:///usr/local/bin/composer.phar/vendor/ symfony/console/Application.php:954"
I solved the first problem with this:
having trouble installing composer
I tried again to instyall all but when composer pull down symfony files there was a root problem, i think due to the fact root took all allocated memory i do and "df -i" and i see "/dev/root have inodes 100% but dev/root have 12000mb" of space so i didn't understand.
Try so to install again composer as pi but without success!
Now i try to mysql -version and also have problem with mysql.
"ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)"
I think it's all correlated with memory limit (that is a good excercise in this case bacause ipothetycal vps have this problem), but i can't figured out what is this.
Have some suggestions? Did i made mistake with swap file? or another?
Thanks
Gabriele

If still interested, try increasing the swap size:
sudo nano /etc/dphys-swapfile
change this line: CONF_SWAPSIZE=100 to this: CONF_SWAPSIZE=512, than:
sudo dphys-swapfile setup
sudo dphys-swapfile swapon

Related

Why Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Application' not found

I have a Laravel/Homestead project that is finally working locally. Now I'm trying to port it over to HostGator and can't get it running due to titled error. I've tried all the suggested solutions to no avail. Including:
composer require laravel/laravel
composer dump-autoload
composer install --no-scripts
composer update
composer update --no-scripts
Nothing works. Same error. If this is a clue, I also tried
php artisan clear-compiled
and get response of
Could not open input file: artisan
I'm about ready to give up on Laravel/Homestead. I've spent countless hours on this framework with nothing but problems to show for it. Would not recommend it to anybody.
You can see the error yourself here:
http://www.tekknow.net/MedAverter/medaverter/
Any suggestions before I throw in the towel?
For the artisan file, the artisan file is not required through includes, you have it in your root project, which is created when you create your Laravel project. Here is the file.
So you need to have that file in your project.
For the missing class, you try to require laravel/laravel but that is not the correct dependency. Again that github repo is a shell for a project, to have Laravel features you need to base of laravel/laravel and include laravel/framework.
Hope this clears up some confusing and can get you on the right track. Secondly you shouldn't port it over, but simply cloning your project and running composer install should be sufficient.
The problem turned out to be two issues.
1. The wrong version of PHP was running. If I ssh'ed into the hostgator server and did
php -v
It showed PHP 5.6.30 even though I had selected Php 7.1 in the cPanel PHP Selector. If I did
tekknow.net/phpinfo.php
it would say I was using 7.1. Called up HostGator tech support and they were able to change it to PHP 7.3.13.
Now if I do:
php artisan clear cache
I no longer get the error about
Parse error: syntax error, unexpected '?' in
/home1/sl1k7f3j/public_html/medaverter/bootstrap/app.php on line 15
which was an error caused by a version of php that doesn't support the ?? operator.
The second problem was a lack of memory issue. If I did
composer update
It would start to work but would fail in about 30 seconds with
Fatal error: Out of memory (allocated 709623808) (tried to allocate
34187559 bytes) in
phar:///opt/cpanel/composer/bin/composer/src/Composer/Json/JsonFile.php
on line 270
The HostGator tech rep could not figure out why that was happening but I got around that issue by manually uploading my local vendor folder to the host server.
Now when I go to http://tekknow.net/medaverter/ it works!

Why does laravel get an application error

In the windows 10 operating system I installed a homestead laravel for project deployment.
After I worked in a vagrant homestead virtual machine, I ran the command vagrand halt
The next day I launched a homestate with the command vagrant up
I connected via SSH to the homestead virtual machine, enter the command php artisan and get the error:
In LoadConfiguration.php line 68:
Unable to load the "app" configuration file.
When opening the site, the error is as follows:
Fatal error: Uncaught RuntimeException: A facade root has not been set. in /home/vagrant/code/projects/forum/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on line 234
RuntimeException: A facade root has not been set. in /home/vagrant/code/projects/forum/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on line 234
This has already been solved, on GitHub: https://github.com/laravel/homestead/issues/1219
Try upgrading to VM 6.
Update
Download and install the latest version of vagrant:
https://www.vagrantup.com/downloads.html
Updating homestead:
vagrant global-status
This will list all your vagrant boxes with box name in the 2nd column
vagrant box update "{box_name}"
Download and install the latest VM: https://www.virtualbox.org/wiki/Downloads
Here you may need to uninstall the old version at first

Homestead Installed PHP7 but I need PHP5

Homestead randomly stopped working for me, so I tried to remove the whole thing and reinstall, but it's not gone well.
I have it "running" after a day and a half of muddling my way through various issues. However, for reasons that I cannot understand, my Homestead box is now running PHP 7.
The instructions I was following had optional options for installing PHP 7, but I intentionally skipped that because we are on PHP 5.
For the life of me, I can't figure out how to fix this. Things I have tried:
I have destroyed and reinstalled the box multiple times.
I have deleted the VirtualBox box multiple times and redownloaded it.
I tried installing v0.3.3 of the box based on one suggestion. (I also updated the homestead.rb script accordingly.) At one point, something failed during the install process with php7.0-fpm: unrecognized service and the configured sites were returning 502 Bad Gateway errors.
After reinstalling with v.0.4.0, it has started "running" as I described (serves the sites as expected, etc.), but with PHP 7.
Searching for solutions has persistently led to a dead-end.
I'm just a dummy front-end developer. :) Laravel, Vagrant, Homestead, all this stuff makes my head hurt. I just want this to work again so I can go back to my actual work. Any advice or alternate avenues of pursuit for researching this problem would be appreciated.
I've been through this issue too and I solved it by installing an old homestead box v0.3.3 and I've used an old release of homestead installer, so I suggest that you remove your current box v0.4.0 and delete your homestead folder then do this:
$vagrant box add laravel/homestead --box-version 0.3.3
and then download an older version of Homestead installer from git, I'm using v2.1.8 it works fine.
Enjoy php 5.6 :)
I had a similar problem where I tried to upgrade Homestead to the most recent Homestead 7.0 box and configure it to run PHP 5.6 instead of PH7, which various sources said was possible via adding a line to the .yaml file specifying the PHP version.
sites:
- map: myproject.local
to: /home/vagrant/Code/craven/public_html
php: "5.6"
What actually happened when I tried that was that I got a 502 CGI gateway error. Here is a summary of the steps I had to take to fix it:
1) SSH into the Homestead virtual machine.
ssh vagrant#127.0.0.1 -p 2222
Taking a look at the nginx error log in /var/log/nginx/ reveals that the PHP 5.6 files the server is looking for don't exist.
You can get confirmation of this by having a look at the executables.
ls -la /usr/bin/php*
2) To install PHP 5.6, run
sudo apt-get update
sudo apt-get install php5.6-fpm
You can confirm that the php 5.6 service is running via the command
service --status-all
3) Once all this is working, refresh the web page for your site and it should now work. In my case, because I was running a Laravel 4.2 site, I then to install Mcrypt:
sudo apt-get install php5.6-mcrypt
4) In order to get my mysql database up and running, I also had to install mysql.
sudo apt-get install php5.6-mysql
And of course after all that, I had to re-import the database contents from the file I'd exported before upgrading the Homestead box.
Note that if you ever destroy and recreate the Homestead box, you will need to repeat all these steps again.

How can I install libmemcached for Mac OS X Yosemite 10.10 in order to install the memcached.so PHP extension on Mamp 3?

I need to install libmemcached on my MacBook Pro running Mac OS X Yosemite.
I have already installed the memcached daemon, but in order to make the PHP memcached.so PECL extension to work, I need to install libmemcached.
I have downloaded the tar.gz from https://launchpad.net/libmemcached/+download, looked at the file README.FIRST:
Hi!
If you are getting this code from http://launchpad.net/libmemcached then
continue reading. Otherwise these directions are not for you (well maybe...).
To obtain code from http://bazaar.launchpad.net/libmemcached you will need to
issue the following command:
bzr branch lp:libmemcached
Once the tree is cloned you will need to build the "configure" script. You
can do this by running the script:
./bootstrap.sh autoreconf
It will set up all of the files you need to build libmemcached. At that
point it is just the typical "./configure; make; make test; make install"
For a tarball release do a "make dist" and for an RPM type "make rpm".
For patches, we prefer you push a branch to launchpad and then submit that
branch to be merged. For more information, see:
https://help.launchpad.net/Code/UploadingABranch
https://help.launchpad.net/Code/Review
Thanks and keep hacking!
Cheers,
-Brian
Seattle, WA.
So I have installed Bazaar and then typed the following command:
bzr branch lp:libmemcached
But what I get is:
bzr: warning: unsupported locale setting
bzr could not set the application locale.
Although this should be no problem for bzr itself, it might
cause problems with some plugins. To investigate the issue,
look at the output of the locale(1p) tool.
Not checking SSL certificate for xmlrpc.launchpad.net.
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data. See "bzr help launchpad-login".
bzr: ERROR: Target directory "libmemcached" already exists.
And if I try to run ./configure and then make, I get a lot of warnings like:
./libmemcached/server.hpp:82:62: warning: implicit conversion loses integer precision: 'uint64_t'
(aka 'unsigned long long') to 'uint32_t' (aka 'unsigned int') [-Wshorten-64-to-32]
libmemcached/csl/scanner.cc:2070:2: warning: 'register' storage class specifier is deprecated
[-Wdeprecated-register]
libmemcached/byteorder.cc:75:10: error: use of undeclared identifier 'htonll'
And 2 errors:
2 errors generated.
make[1]: *** [libmemcached/libmemcached_libmemcached_la-byteorder.lo] Error 1
make: *** [all] Error 2
So actually I can't install libmemcached. Is there any option I can try, how can I resolve this issue? Why all those errors?
Thanks for the attention!
Hope for some help.
I've managed to get libmemcached to compile and install on OSX 10.10.3 by changing the configure script and one of the source files.
In configure I changed the lines:
if ac_fn_cxx_try_compile "$LINENO"; then :
ac_cv_have_htonll=yes
else
ac_cv_have_htonll=no
fi
to:
ac_cv_have_htonll=no
Then in clients/memflush.cc I changed the 2 instances of:
if (opt_servers == false)
to:
if (opt_servers == NULL)
After that the usual configure, make, sudo make install worked ok (albeit with lots of warnings). The library then seems to work fine, with pylibmc in my case.
I know the question was asked ages ago but the problem is in my opinion somewhere else, namely in a missing include.
This is how I fixed the issue on (macOS High Sierra 10.13):
In bytesorder.cc I added these 3 lines after the byteorder.h include:
#if defined HAVE_HTONLL && defined HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif

Symfony fatal error when trying to run configurator

I successfully completed the configuration check on web/config.php when installing Symfony on a U10 LAMP server, but now running across this error when trying to run web/app_dev.php/_configurator/:
Fatal error: Interface 'Symfony\Bridge\Doctrine\RegistryInterface' not found in /var/www/symfony/vendor/symfony/src/Symfony/Bundle/DoctrineBundle/Registry.php on line 26
Did I forget to install something?
You are missing Doctrine bridge for some reason. I guess something went wrong when you installed vendors (github might have been down for a minute and it just skipped this part).
Try to reinstall vendors:
./bin/vendors install
Or just download Symfony2 with pre-installed vendors.

Categories