How to use the plugin sfTCPDFPlugin? - plugins

I work with symfony 1.4, and I want to use the plugin sf sfTCPDFPlugin.
I followed step by step all the instructions, I read the question “How to generate PDF using sfTCPDFPlugin in symfony 1.4?” and answers, but when I try to generate a PDF file, I get the following error:
The server returned a "500 Internal Server Error".
In detail, I have done the following:
I installed PEAR - PHP Extension, and run OK.
I installed
successfully the plugin sfTCPDFPlugin
I downloaded and installed
the "TCPDF library"
$ symfony plugin:publish-assets
$ symfony cc
Copy the /plugins/sfTCPDFPlugin/config/pdf_configs.yml into the config folder of your application
Now I try to test the plugin, but when I want to run the function "test" that is included in the plugin, I get the following error:
The server returned a "500 Internal Server Error":
PHP Fatal error: Class 'TCPDF' not found in D:\proyectos\conflictosnew\plugins\sfTCPDFPlugin\lib\sfTCPDF.class.php on line 14
I use Wampsever under Windows XP
Any idea what could be happening?

I have found an error! The link contained in: "Download the TCPDF library" at: http://www.symfony-project.org/plugins/sfTCPDFPlugin, is incorrect, because download fonts only, not the complete library
In the following link you can find the complete library TCPDF:
http://sourceforge.net/projects/tcpdf/files/

Related

PHP Fatal error: Class 'RemoteWebElement' not found in

I have a symfony project that run normal in command line:
php app/console server:run
But, I want to run inside PhpStorm. When I try to do this, it gives the fatal error:
PHP Fatal error: Class 'RemoteWebElement' not found in
I already tried to look the oficial documentation of the classe:
http://facebook.github.io/php-webdriver/classes/RemoteWebElement.html. But I didn't found information that culd help me.
I also added the compose dependency:
composer require facebook/webdriver
But had no effect!
=======================================
I'll explain step-step how to get this the bug (It will be very long!):
I have:
PHP 5.5.9
PhpStorm 10.0.3
composer 1.0-dev (7117a5775ffdcdfd31bbd52a138a6f9c65e7e3c2) 2016-02-03
So, create a new symfony project (current version 3.0) and add composer dependencies:
symfony new project
cd project
composer update
Then, open this project inside of phpstorm and I configure settings for to run the project:
Settings -> Languages & Frameworks -> PHP
"PHP language level": 5.5
"Interpreter": 5.5.9
Add through plus(+) the PHP folder:
/usr/share/php
Click 'OK'
Now, try to run de project through PhpStorm by the shortcut:
Ctrl+Shif+F10.
Will appear the bug:
PHP Fatal error: Class
'Symfony\Bundle\FrameworkBundle\Test\WebTestCase' not found in
Solve this by this way inside of PhpStorm:
Settings -> Languages & Frameworks -> PHP -> PHPUnit
Choose: "Use custom autoloader"
And, in the field "Path to script", informe the autoloader's address. For example:
/home/murilo/git/slu/app/autoload.php. Click 'OK'.
Again, try to run de project through PhpStorm by the shortcut:
Ctrl+Shif+F10
Will appear the bug:
PHP Fatal error: Class 'Doctrine\Tests\Common\Cache\CacheTest' not
found in
Solve this through this command inside the project folder:
composer require maslosoft/cachetest:dev-master -n --no-progress
For the last time, try to run de project through PhpStorm by the shortcut:
Ctrl+Shif+F10
Will appear the bug:
PHP Fatal error: Class 'RemoteWebElement' not found in
I'm at this bug.
Please, someone knows how I can overcome this bug? o.O
I struggled with the same exact issue as you have described. After breaking my head for most of the day with this problem, I found the issue.
When you execute the command php app/console server:run in command line, it sets up a server and runs the website. However, when you run the project in PHPStorm, it doesn't actually run it as a server but runs it as a PHPUnit. What you need to do is configure a PHP Web Application in PHPStorm and run that.
Check the image below where I have configured the website. When I run the Web Application, it will run by the url and it will show up in your browser.

sails­postgresql Error while using sails lift command?

While running $ sails lift command , I am getting this error.
info: Starting app...
error: Trying to use unknown adapter, "sails­postgresql", in model `adminintro`.
error: Are you sure that adapter is installed in this Sails app?
error: If you wrote a custom adapter with identity="sails­postgresql", it should be in this app's adapters directory.
error: Otherwise, if you're trying to use an adapter named `sails­postgresql`, please run `npm install sails-sails­postgresql#0.10.x`
Please help me out guys ...
Got the answer ... It was unicode mistake . I have copy n pasted the code for local.js from one of my coworker's pdf file. So when I pasted that code in my local.js "-" was replaced with some unicode http://www.fileformat.info/info/unicode/char/00AD/index.htm .. and that was causing this issue..

MongoClient not found in WAMP

I have been trying to run MongoDB on WAMP all day and It shows the error: Fatal Error: MongoClient class not found. I have a windows 64 bit, Wamp 32 bit ( after trying and failing at running wamp 64), MongoDB 64 bit. I downloaded mongo php_driver from https://s3.amazonaws.com/drivers.mongodb.org/php/index.html. Copied php_mongo-1.5.1-5.4-vc9.dll to the php extension folder as php_mongo.dll. Added it as extension in php.ini (configuration setting file). My php.ini extension section looks like this:
extension=php_bz2.dll
extension=php_curl.dll
extension=php_com_dotnet.dll
extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_gmp.dll
extension=php_intl.dll
extension=php_imap.dll
;extension=php_interbase.dll
extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll ; Must be after mbstring as it depends on it
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll ; Use with Oracle 11gR2 Instant Client
extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
extension=php_shmop.dll
extension=php_mongo.dll
I've reboot the server. I don't see Mongo on the phpinfo() file and also the php error log files shows the following:
c:/wamp/bin/php/php5.5.12/ext/php_intl.dll' - The specified module could not be found.
PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.5.12/ext/php_ldap.dll' - %1 is not a valid Win32 application.
PHP Warning: PHP Startup: mongo: Unable to initialize module
Please tell me what I am missing because I have tried everything.
Thank you!
To fix the php_intl.dll error do the following using the wmapmanager menus
wampmanager -> Apache -> Version -> and click on the 2.4.9 version number
This will cause wampmanager to rebuild all the SYMLINKS in the \wamp\bin\apache\apache2.4.9\bin folder.
As to the mongo error, are you sure you are editing the correct php.ini file.
Again use the wampmanager menu system to edit the correct php.ini file
wampmanager -> PHP -> php.ini
I expect the extension was not added to this file so add
extension=php_mongo.dll
like you did to the PHP CLI version of the ini file.

Why would Eclipse not be able to include a file when running a PHPUnit test?

I have the following class and unit test in a PHP project in Eclipse:
I know my unit test works as I can run it at the command line:
Now I want to run this test from Eclipse. I set up PHP Unit in Eclipse like this:
However, when I run the PHPUnit tests:
It tells me that it can't include the class file:
/usr/bin/php -c /var/folders/UA/UAv38snBHd0QMgEPMCmM9U+++TM/-Tmp-/zend_debug/session4910937990995915704.tmp -d asp_tags=off /Applications/eclipse/plugins/org.phpsrc.eclipse.pti.tools.phpunit_0.5.0.R20101103000000/php/tools/phpunit.php --log-junit /var/folders/UA/UAv38snBHd0QMgEPMCmM9U+++TM/-Tmp-/pti_phpunit/phpunit.xml /Volumes/data/domains/et/extjslayout/phpunittest/tests
PHP Warning: include_once(../Product.php): failed to open stream: No such file or directory in /Volumes/data/domains/et/extjslayout/phpunittest/tests/ProductTest.php on line 3
PHP Warning: include_once(): Failed opening '../Product.php' for inclusion (include_path='/usr/local/PEAR') in /Volumes/data/domains/et/extjslayout/phpunittest/tests/ProductTest.php on line 3
PHP Fatal error: Class 'Product' not found in /Volumes/data/domains/et/extjslayout/phpunittest/tests/ProductTest.php on line 9
Why would PHPUnit be able to find the class when run from the command line but not when run from Eclipse?
When you start something from the command line, the "current directory" has a well-defined meaning: It's the directory where you started the command.
In Eclipse, what is the "current directory"? It's probably the directory from which you started Eclipse or maybe the folder in which Eclipse is installed.
I haven't used PHP in Eclipse before but for other languages, I can set the current directory in the launch config somewhere. If that doesn't work, define a variable which points to your project and then use absolute paths (using that variable as a starting point).
Have same problem. Found only solution by creating tests with internal PHPUnit wizard like at this screenshot:
Source: HowTo create a Test Case Class from a PHP Class
But following investigate show that your test case file should contain reference to tested code for example like this: require_once 'C:\Apache2\htdocs\jobeet\src\Ibw\JobeetBundle\Utils\Jobeet.php';
Other experiments with plugin config not bringing luck. So in my opinion PHPUnit from PHP Tools not well developed plugin. Consider using MakeGood plugin as better alternative.

Symfony 1.4x and sfTCPDFPlugin

I have installed sfTCPDFPlugin in my project, but when I try to test if the installation is alright (with the source found on the official site) I get the error:
Fatal error: Class 'TCPDF' not found in C:\wamp\www\mairie\plugins\sfTCPDFPlugin\lib\sfTCPDF.class.php on line 12
How can I fix it?
Read the readme tab here : http://www.symfony-project.org/plugins/sfTCPDFPlugin
It says you have to download the tcpdf library, not only the sfTCPDFPlugin.
i faced with same problem, and i did the following task it will also help you.
first of all run: symfony plugin:uninstall sfTCPDFPlugin then remove the sfTCPDFPlugin directory form your plugin folder.
mow do the following setps:
1. cd your project path/symfony
2. symfony plugin:install sfTCPDFPlugin
3. download the tcpdf library unzip it and past into your sfTCPDFPlugin/lib now your directory looks like your project path/symfony/plugins/sfTCPDFPlugin/lib/tcpdf
now change your ProjectConfiguration.class.php to add $this->enablePlugins( array('sfTCPDFPlugin') ); now run the symfony plugin:publish-asstes and finally clear the cache symfony cc.