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!
Related
I'm working on a project with protocol buffers and after i compiled a proto file, i cant seem to include it neither run it cos it keeps giving me this exact error:
PHP Fatal error: Class 'Google\Protobuf\Internal\Message' not found in /app/generated_files/message.php on line 13
On message.php i have the auto generated file from a .proto file and it includes Google\Protobuf\Internal\Message.
While reading on the protobuf github issues, i found that a person had the same problem where he concluded that it was the composer's fault. However in my case that wouldnt be the issue cos i didnt use composer.
I used pecl to install protocol buffers, and i have the library protobuf.so located in /etc/php5/apache2/XXXXXXXXX. I also added extension=protobuf.so on the last line of php.ini.
Keep in mind that im using docker for everything, therefore it might be something different but i still doubt.
In case anyone ends up here with the same question: you just need to add componser autoloader to your file include_once './vendor/autoload.php'; (change path as required)
I had the same problem, but the reason was different for me:
Git somehow messed up the casing of the folders, which lead to a wrong file path translation.
As soon as I fixed the casing ([...]/src/Google/Protobuf instead of [...]/src/google/protobuf in the vendor folder)
I wish to use TCPDF so have downloaded the code and am having trouble using it.
I work on Mac locally using MAMP.
My project is stored in:
/Applications/MAMP/htdocs/my-project-title
I place the whole tcpdf folder in my project so it's location is:
/Applications/MAMP/htdocs/my-project-title/tcpdf
I found a file tcpdf_include.php in the examples directory so I pulled it out and placed it also in the tcpdf folder:
/Applications/MAMP/htdocs/my-project-title/tcpdf/tcpdf_include.php
So I wasn't sure if this was right but it seemed so. I then referenced tcpdf_include.php in my script: require_once('../tcpdf/tcpdf_include.php'); and it found the file all good.
Now I was confused as to how exactly this was working. I ran an example and got nothing and error log states:
[04-Nov-2015 16:27:36 Europe/Berlin] PHP Fatal error: Class 'TCPDF' not found in /Applications/MAMP/htdocs/my-project-title/scripts/myscript.php on line 15
... so it seems like it's just not running the script. I went to the config file to attempt to edit some stuff there.
I changed the following in the config file:
define ('K_PATH_MAIN', '/MAMP/htdocs/my-project-title/tcpdf/');
define ('K_PATH_URL', 'http://localhost:8888/my-project-title/tcpdf/');
These are now inline with how my project is set up. But I'm still getting the above error when I try to run the script.
What am I missing are there any examples of how to properly configure TCPDF?
Try this:
Store the script you are trying to run in /Applications/MAMP/htdocs/my-project-title, eg. /Applications/MAMP/htdocs/my-project-title/test.php
In that script, just do require_once('tcpdf/tcpdf.php'); (I'm assuming the tcpdf folder is still sitting here: /Applications/MAMP/htdocs/my-project-title/tcpdf)
You should then be able to instantiate an instance of the TCPDF class.
You shouldn't need to worry about anything else - it should just work. If it doesn't, try creating a fresh folder in your htdocs folder, drop a fresh copy of tcpdf in there and try again, just in case you've moved something in your current version that is messing things up.
To be clear, this is what test.php should contain:
require_once('tcpdf/tcpdf.php');
$pdf = new TCPDF();
Good luck!
I have been using modules in my project is written with CodeIgniter.
What I have
Folders
-->application
-->cache
-->config
-->config.php (configuration file for auth, I copied the codes to config.php)
-->controllers
-->core
-->errors
-->helpers
-->hooks
-->language
-->libraries
-->auth's libraries files.
-->logs
-->models
-->modules
-->admin
-->controllers
-->auth.php
-->models
-->ion_auth_model.php
-->views
-->auth
-->login.php
-->home
-->third_party
-->views
-->assets
-->system
What the problem is
When I go to localhost/home/auth/login.php, an error message is occurred. On the screen is written
An Error Was Encountered
The configuration file ion_auth.php does not exist.
I guess the problem is about the iounauth configuration file will be moved config folder before setup. I didnt moved it to config folder. Instead of it, I copied all the codes from that file, to the config.php
So how can I solve this problem? I need to see the login screen instead of this error message. I think I should change some lines on auth.php in controller folder. Because I am using config.php instead of ionauth.php for config folder.
I've just had a quick scan of the ion_auth Library and model and the easiest thing to do would be:
Remove $this->load->config('ion_auth', TRUE); from both the library and model.
do a string replace in both the library and model:
FIND: , 'ion_auth') REPLACE WITH: )
I have done a quick scan of the files and I can't see anywhere where this would break anything but just be careful when you're doing it (maybe do it one at a time).
The above to steps should allow you to use the ion_auth config items in your config.php
Please note that I have not tested this.
Hope this helps!
I'm also facing this issue when move my web to linux server, it solved by renaming config/Ion_auth.php to config/ion_auth.php
I am using and have been using the framework CodeIgniter for a while. It works perfectly on my localhost, once I upload it to a server it gives the following error message
Unable to locate the model you have specified: auth_model
To point it out, it works on my apache perfectly, do you have any idea to what the problem can be? I am talking with customer support of the webbhotel, but they can't seem to find anything on their end.
Thanks in advance.
Edit: It manages to load many different files, the session library, my own controllers, helpers and view files. It just models that it stops at, I've named them all 'Auth_model.php", 'Login_model.php' etc. The models themselves are declared class Auth_model extends CI_Model {}
Sounds like a path issue,
I would first check where your starting at and get some data to compare with
CodeIgniter FCPATH and APPATH are both set in the main index.php file,
FCPATH = root
APPATH = application folder
Find out what your paths are set to, check your config/config.php file make sure you have correct info there.
Just a thought, are you using a common auth library? Sucb as freak/ion/bit/etc auth's
The session error, is being caused by echoing data you can google the error and get a decent understanding of the error from there.
As it turns out the webhotel (one.com) got a delay when you upload, hence it was a bit troublesome to actually troubleshoot it, but here it goes. Every file name except for the exception of MY_Controller needs to be in lower cases. So the answer was pointed out by some people.
The problem is with codeigniter because it looks for lower cases only in some cases. So yeah, models should be in lower cases from now on!
I tried bake with Cakephp 2.0.4 stable with 'cake bake' command
But it's giving me below errors...
Unable to set console path for app/Console.
CakePHP is on your `include_path`. CAKE_CORE_INCLUDE_PATH will be set, but commented out.
Unable to set CAKE_CORE_INCLUDE_PATH, you should change it in /home/wmetools/public_html/security/app/Console/myapp/webroot/index.php
Project baked but with some issues..
Your database configuration was not found. Take a moment to create one.
Is there a reason why this is happening?
If you meant to say
CakePHP is not on your include_path
** Code from the webroot/index.php file **
For ease of development CakePHP uses PHP's include_path. If you
cannot modify your include_path set this value.
Setting the include path will get rid of this error. There are two ways to accomplish this:
Edit your php ini file (on wamp this would be WAMPMENU->PHP->php.ini)
Better Description on how to.
or
// THIS METHOD IS NOT RECOMMENDED FOR THIS SITUATION
1. ini_set("include_path", ".:../:./include:../include");
If you do not want to mess with all that, just set the include path manually in the index.php file.