So I have just gone through a update going from CI 2.0.4 to 3.1.4 and ran into the issue with Sparks now being redundant I've had to move onto composer to get php active record working..
however I have had autoloading issues/ Solved by including the model directly into the controller ie: require_once(APPPATH.'models/User.php');
But now im getting the following error..
An uncaught Exception was encountered
Type: ActiveRecord\DatabaseException
Message: Empty connection string
Filename: /var/www/html/vendor/php-activerecord/php-activerecord/lib/Connection.php
Line Number: 105
btw to load the composer autoload I've put: config['composer_autoload'] = '../vendor/autoload.php'; as the vendor directory sits outside the application folder in its parents folder.
Any help would be greatly appreciated..
You can move the vendor directory to your public_html/www and try
config['composer_autoload'] = FCPATH.'vendor/autoload.php';
Related
I tried installing this composer module on my Laravel app https://github.com/alihesari/laravel-social-auto-posting but im facing some issues. Im avoiding composer since it requires me to update my Laravel version which will break things (im runnin under 5.1.9).
Steps that I took so far:
1) wget https://github.com/alihesari/laravel-social-auto-posting/archive/master.zip - inside htdocs directory
2) unzipped master.zip and renamed folders. Moved folders inside /vendor/ folder under this structure:
/vendor/toolkito/larasap/ - This folder contains the src subfolder as shown in the repo.
3) Added this reference in \vendor\composer\autoload_namespaces.php and in \vendor\composer\autoload_psr4.php: 'Toolkito\\Larasap' => array($vendorDir . '/toolkito/larasap/src'),
4) Configured my secret keys in the config file, for the proper social media connection
5) Added use Toolkito\Larasap\SendTo; in the main controller, as per repo's instructions
6) Added SendTo::Twitter('Hello, I\'m testing Laravel social auto posting'); to a function that I use and ended up in this error:
FatalThrowableError in HomeController.php line 47:
Fatal error: Class 'Toolkito\Larasap\SendTo' not found
I also tried use Vendor\Toolkito\Larasap\SendTo; in step 5, and ended up with the same error message.
Any suggestions please?
I am using Symfony 2.8.18. I was always able to debug the previous error messages I had. I searched on Google for same errors but I did not find anything. Everything worked perfectly before. I restarted my local server and get the following error message:
Warning: class_implements(): Class �]� does not exist and could not be
loaded
Here is a link to the screenshot of the message: strange bug screenshot.
I deleted the cache by removing the corresponding folders and by using the following command:
php app\console doctrine:cache:clear-metadata && php app\console doctrine:cache:clear-query && php app\console doctrine:cache:clear-result
But it did not solve my problem. I do not know how to understand this error message.
Do you have any ideas on how to debug the code?
I did not change anything but it seems one or several files were corrupted. The solution was to:
Remove the vendor folder;
Run composer install.
My problem was solved by doing this.
I did the following commands:
composer global require "laravel/installer=~1.1"
and
set PATH=%PATH%;%USERPROFILE%\AppData\Roaming\Composer\vendor\bin
But when I try to do:
laravel new blog
I get the following error:
Notice: Undefined variable: output in C:\Users\****\AooDara\Roaming\Composer\vendor\laravel\installer\src\NewCommand.php on line 55
Fatal error: Call to a member function writeln() on null in C:\Users\****\AooDara\Roaming\Composer\vendor\laravel\installer\src\NewCommand.php on line 55
Any idea of what went wrong?
Seems like you already have a directory called 'blog' in your application directory. Try creating a laravel app with different name or delete / rename existing 'blog' directory and try again.
for example laravel new helloapp.
However, I think the error showing at the console is a bug of laravel new command. I could see the error at the console when I tried to create a app with same name again from same directory.
The error not exists now. Try creating other application.
I'm having some trouble with artisan/packages.. I've added a package to my composer file and ran composer update and an error was returned:
PHP Warning: require(/home/xxx/public_html/bootstrap/autoload.php): failed to open stream: No such file or directory in /home/xxx/public_html/artisan on line 16
I can see that require path is incorrect, my structure is like so:
/home/xxx/bootstrap
/home/xxx/app
/home/xxx/vendor
/home/xxx/public_html
I hadn't changed any of the paths and everything seemed to work out of the box with this structure, basically removing the public folder and pushing everything up a directory.
I've opened up Artisan tried a couple of paths that kept failing so i've changed them to absolute:
require '/home/xxx/bootstrap/autoload.php';
It seemed to work from here on, but at the end of the process got another error:
Writing lock file
Generating autoload files
[RuntimeException]
Could not scan for classes inside "app/commands" which does not appear to be a file n or a folder
Rather than continue to mess it up i thought now would be a good time to clear it up, any ideas how to fix this?
Make sure you are using php 5.3 or higher.
Run php -v
Try creating an empty "app/commands" folder, fixed the issue for me!
I moved a Pyrocms site to another server.
Go to index: blank page.
Turn on errors: get this
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Pages::$session
Filename: core/Model.php
Line Number: 50
Fatal error: Call to a member function set_flashdata() on a non-object in /var/www/vhosts/brokentalkers.com/httpdocs/system/pyrocms/modules/modules/models/module_m.php on line 193
If it sheds any light, I made a tar.gz of the contents of the old httpdocs folder, and extracted it in the new httpdocs folder.
I made a duplicate of the database with an identical user, so config/database.php shouldn't need changing.
Any ideas? Thanks in advance.
It seems like $session class is not initializing correctly.
Check for default_ci_sessions table, if you are using sessions for database.
Check if the constructor is loading sessions library.
Check if session is in autoload.php config