Originally I had my entity classes (PHP with annotations for Doctrine) in the models folder of my CodeIgniter setup. I decided this wasn't such a great idea so I moved all of my entities into an "Entities" folder and updated my Doctrine.php file accordingly...but now when I try to run really anything with the Doctrine CLI I get this error:
PHP Warning: require([application path withheld]/application/models/Entities/grocery_CRUD_Model.php): failed to open stream: No such file or directory in [application path withheld]/application/libraries/Doctrine/Common/ClassLoader.php on line 163
PHP Fatal error: require(): Failed opening required '[application path withheld]/application/models/Entities/grocery_CRUD_Model.php' (include_path='.:/usr/share/pear:/usr/share/php') in [application path withheld]/application/libraries/Doctrine/Common/ClassLoader.php on line 163
I know Doctrine is now looking in the correct directory, but it seems to still think that my grocery_CRUD_Model.php should be in that directory. This file was in the same folder as the other entities before, but it never had any Doctrine annotations. I've tried clearing Doctrine's metadata, query, and result cache to see if Doctrine would forget about this file but it doesn't help.
What's going on here? Why does Doctrine insist on having that file in the Entities folder?
I found the answer, I used grep to try and see if there was some sort of grocery_CRUD_Model cache object file somewhere and I ended up discovering that somehow one of my entities (just one, I must've been experimenting) extended grocery_CRUD_Model.
I removed the inheritance and it worked!
Related
I'm trying to generate an entity class with the phalcon model pedido_item command and the generator, for some unknown reason (to me) seems to be pointing to my project's parent directory (Applications) instead of its own.
Here's the error I get.
PHP Warning:
file_put_contents(/home/nmobregon/Applications/app/models/PedidoItem.php): failed to open stream: No such file or directory in
/home/nmobregon/phalcon-devtools/scripts/Phalcon/Builder/Model.php on
line 519
Error: Unable to write to
/home/nmobregon/Applications/app/models/PedidoItem.php
Of course I haven't touched the generator code so it seems really strange that somehow is now pointing to a worng path.
Any ideas? Please tell me if I should add more info.
Thanks
I've been trying to install a web application which is built using the Laravel framework. The application is hosted as a GIT repository.
Here is a detailed description of my problem to clarify how I'm facing it.
For the first time I cloned the repository in the following path:
/var/www/app.example.com/script/
Then created a symbolic link to it's public directory like this to follow my server's nginx routing convention:
ln -s /var/www/app.example.com/script/public /var/www/app.example.com/public_html
But I decided to move everything out of the script directory to one upper level and this is where my problem started.
I moved the Laravel installation to /var/www/app.example.com/ and made nginx to directly load its public directory as the root path.
Now the problem is every time I try to load the application it's trying to read the files from their previous location:
Warning:
require(/var/www/app.example.com/script/public/../bootstrap/autoload.php):
failed to open stream: No such file or directory in
/var/www/app.example.com/public/index.php on line 21
Fatal error: require(): Failed opening required
'/var/www/app.example.com/script/public/../bootstrap/autoload.php'
(include_path='.:/usr/share/php:/usr/share/pear') in
/var/www/app.example.com/public/index.php on line 21
Notes to keep in mind:
I've used composer to install all the dependencies
curl -sS https://getcomposer.org/installer | php
php composer.phar install
I'm using nginx as my web server
I've tried removing everything (including ~/.composer) and start all over again to no avail.
I have even tried to move the whole project into a new root directory
It seems the problem is with __DIR__ magic constant since it contains the wrong path
Weirdly enough if I echo __DIR__ it prints the correct path but in the next line in which it's used it has the incorrect old path
I hope I have been clear enough in my description to avoid any confusion and possible down-votes.
So i could be completly wrong here, but is there a configuration file where it might have saved it? Or is there still something left in the script directory that can mabey cause this? As when the __DIR__ outputs the right value, then it should in the other code too.
I have installed a new zf project, and get the next error:
Warning: require_once(Zend/Application.php) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\zend\public\index.php on line 18
I have set the include path and in addition i have uploaded zf to the library folder.
But, I can't find any trace to a file named Application.php ...
Somewhere along the line you have mixed ZF1 and ZF2 instructions or code. There is no Zend/Application.php in ZF2 (this is a ZF1 thing), and ZF2 apps do not generally have a 'library' folder. So either you are using ZF2 but have followed some app setup instructions for ZF1, or you've used the ZF1 command line tool to create a ZF1 project and have then put ZF2 into the library folder.
Here is the ZF2 skeleton app: https://github.com/zendframework/ZendSkeletonApplication - this should give you an idea what your app should look like.
As the error obviously says Zend/Application.php is not there. Check you include path and your folder.
I hope I have phrased that correctly, but I am trying to install vendors into my symfony2 project, which I have just downloaded from SVN, but I keep getting this error,
[Symfony\Component\Config\Exception\FileLoaderLoadException]
Cannot import resource "parameters.ini" from "/Users/john/Sites/trunk/awesome/app/zone/config/../../config/config.yml".
[InvalidArgumentException]
The file "parameters.ini" does not exist (in: /Users/john/Sites/trunk/awesome/app/zone/config/../../config, ).
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command.
Obviously it seems to be looking in the wrong directory, but I am not sure what file is pointing to those files.
Also, I am quite new to Symfony, so I am unsure of where to look to start fixing the problem...
I suppose that you have something like this into app/config/config.yml
imports:
- { resource: parameters.ini }
And you haven't parameters.ini file
The parameters.ini file is used into Symfony 2.0 and now, in Symfony 2.1 (if you use composer,I suppose that you use Symfony 2.1) this file in turned into parameters.yml so please check for this "error" and try again
I'm guessing parameters.ini file wasn't put into your repository as it stores sensitive data (like database password).
You should create it locally. Some people put template files into the repository, so look for files named like parameters.ini.dist. If there's no such file grab the original file from symfony standard edition and adapt it to your environment.
As others pointed out, Symfony 2.1 uses parameters.yml instead of parameters.ini by default. You can still use ini file if you want though. If you have a parameters.yml file or want to start using it, follow instructions given in other answers.
I fixed this by deleting the vendor directory and ran composer install again.
When I try to generate a CRUD test for a new project I am getting a PHP Warning and a Fatal Error.
The errors relate to files that it cannot find, however, I have checked and the files are definitely there.
The error text is 'require_once(lib/model/map/QuestionMapBuilder.php): failed to open stream: No such file or directory in c:\webroot\askeet\lib\model\om\BaseQuestionPeer.php on line 547'
What details of my project should I check?
I think it's a problem with your include path.
Check it, the require_once() call is looking for lib/model/map/QuestionMapBuilder.php
But your include_path is C:\webroot\askeet\lib
Which, when resolved together into a full path, would look like this
C:\webroot\askeet\lib\lib\model\map\QuestionMapBuilder.php
So, I think your solution is to add C:\webroot\askeet to your include path.
You are generating crud for the Question model class but it doesn't seem to exist. Documentation on using the crud generator
First you must use the schema.yml file to define your database, and run
./symfony propel:build-model
to generate your model files. (this will generate lib\model\map\QuestionMapBuilder.php)
I finally tracked down the issue. In my PHP.ini files, they were setup wit the default UNIX file path settings.
Weirdly nothing had ever been broken by this incorrect configuration. Plus, everything in Symfony had worked up until now.
I have switched to Windows style file_path and all is well again.
Thanks for all the answers!