php,doctrine,symfony-2.1,sonata-adminRelated issues-Collection of common programming errors
Eugene
php session memcached redundancy
Colleagues! I’m running php 5.3 (5.3.8) with memcache (2.2.6) client library (http://pecl.php.net/package/memcache) to deal with memcached server. My goal is to have failover solution for sessions engine, namely:Only native php sessions support (no custom handlers) Few memcached servers in the poolWhat I expect is that in case if one of memcached servers is down, php will attempt to utilize the second server in the pool [will successfully connect it and become happy], however when first memcache
Răzvan Panda
php postback
If I pass PHP variables with ‘.’ in their names via $_GET PHP auto-replaces them with ‘_’ characters. For example:<?php echo “url is “.$_SERVER[‘REQUEST_URI’].”<p>”; echo “x.y is “.$_GET[‘x.y’].”.<p>”; echo “x_y is “.$_GET[‘x_y’].”.<p>”;… outputs the following:url is /SpShipTool/php/testGetUrl.php?x.y=a.b x.y is . x_y is a.b…. my question is this: is there any way I can get this to stop ? Cannot for the life of me figure out what I’ve done to deserve this 🙁 PHP version
user3439338
php wordpress apache .htaccess mod-rewrite
I want to redirect domainA.com/folder/ which originates within an older wordpress installtion to domainB.com/folder1/folder2/ which is the link to the page within my new wordpress installation wihtout the url changing. I have managed to achieve this with the .htaccess file inside domainA.com/folder/ which reads:RewriteEngine On RewriteCond %{REQUEST_URI} ^/folder RewriteRule ^(.*)$ http://www.domainB.com/folder1/folder2/ [P] The Rewriterule [P] (proxy) flag does what I want and redirects the pag
Matej
php json odbc sqldatatypes
I want to return a JSON object from a database (MyTable) which contains two columns – ID (int) and Name (string).The script below produces a JSON like:[{“ID”:”0″,”Name”:”John”},{“ID”:”1″,”Name”:”Doe”}]You can see, that the ID is returned as a string. How can I accomplish it in a way that an ID would be returned as integer:[{“ID”:0,”Name”:”John”},{“ID”:1,”Name”:”Doe”}]I do not want to read and parse the result array from the ODBC since I want to use generic queries like:SELECT * FROM TableXXXHere
JaSk
php doctrine symfony-1.4
While following the symfony tutorial (1.4.4) I’m getting an error with ODBC/mssql 2008.SQLSTATE[07002]: COUNT field incorrect: 0 [Microsoft][SQL Server Native Client 10.0]COUNT field incorrect or syntax error (SQLExecute[0] at ext\pdo_odbc\odbc_stmt.c:254). Failing Query: “SELECT [j].[id] AS [j__id], [j].[category_id] AS [j__category_id], [j].[type] AS [j_type], [j].[company] AS [j_company], [j].[logo] AS [j_logo], [j].[url] AS [j_url], [j].[position] AS [j_position], [j].[location] AS [j_locati
logan
php phpexcel
I am using PHPExcel (found here: https://github.com/PHPOffice/PHPExcel). If i try to read more than approximately 2000 rows then it shows memory error as follows.Fatal error: Allowed memory size of 134217728 bytes exhausted (triedto allocate 71 bytes) in/home/sample/PHPExcelReader/Classes/PHPExcel/worksheet.php on line 89My Excel data range is A1:X2000Below is my code used to read the excel.ini_set(‘memory_limit’, ‘-1’); /** Include path **/set_include_path(get_include_path() . PATH_SEPARATOR .
Shawn
php exception doctrine2
This is the relevant code:throw new Exception(“Message”);And this is the error message I get:Fatal error: require() [function.require]: Failed opening required’C:\wamp\www\drupal-7.15\sites\all\modules\dbManip\Entities\Exception.php'(include_path=’.;C:\wamp\bin\php\php5.3.13\pear\’) inC:\wamp\bin\php\php5.3.13\pear\Doctrine\Common\ClassLoader.php on line163I believe Doctrine is trying to load the Exception class definition as if it were just another entity of mine, but as far as I know, Exceptio
l008com
php ping icmp
I’m trying to do actual, genuine ping using ICMP packets, natively in PHP. Right now I’m using exec to run the ping command, but you never quite know what it’s going to output, which makes it very hard to format the results for web. Different network setups can result in some crazy output. So I wrote my own pinger using socket_create() (with help from the manual comments), but that also doesn’t work. Apparently you can’t create a raw socket unless your apache server is running as root. That’s no
Phil Cross
php linux apache ownership
I currently manage 8 different sites for my organisation and built a central management website to help manage the content on them all. I currently have a file uploader on the administration website that allows me to upload ZIP files to the server. This script then unzips the package, and moves the files to different parts of the server. The problem is, when I upload files through the browser, it assigns ownership to apache (for both user and group). This causes me a problem when I try to overwr
Andrew
php mysql date strtotime
In my vaguely large app, I get dates from the MySQL database all the time, and until today, where and when I formatted them with PHP’s date() command was random. I wanted to tidy that up today and move it all entirely to the view, rather than the retrieval. But I ran into some problems. My method so far has been, when getting a date from the database, I pass it to the rest of the app after running strtotime() on it, so that the date() functions have something they can work with. So, question the
JaSk
php doctrine symfony-1.4
While following the symfony tutorial (1.4.4) I’m getting an error with ODBC/mssql 2008.SQLSTATE[07002]: COUNT field incorrect: 0 [Microsoft][SQL Server Native Client 10.0]COUNT field incorrect or syntax error (SQLExecute[0] at ext\pdo_odbc\odbc_stmt.c:254). Failing Query: “SELECT [j].[id] AS [j__id], [j].[category_id] AS [j__category_id], [j].[type] AS [j_type], [j].[company] AS [j_company], [j].[logo] AS [j_logo], [j].[url] AS [j_url], [j].[position] AS [j_position], [j].[location] AS [j_locati
Broncha
php sql-server-2008 datetime doctrine doctrine2
I’m using Doctrine 2.2 with php 5.3 on an apache server.So far I’ve stumbled upon the following problem: When I try to update a datetime column I get: SQLSTATE[22007]: [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting date and/or time from character string.I’ve even gone so far to make a get onto the column and then use that with only 1 day added to it to set the new date……same result.When I instead change both the column in the database and in the entit
ownking
symfony1 doctrine odbc sql-azure
My DSN String looks like this:dsn: odbc:DRIVER={SQL Server};Server=myserver.database.windows.net;Database=mydb;username: myusername@myserverpassword: mypwdWhen I run the symfony task:symfony doctrine:build-schemaIt seems be a successfull connection, but it breaks with the following error:SQLSTATE[42000]: Syntax error or access violation: 2812 [Microsoft][SQL Server Native Client 10.0][SQL Server]Could not find stored procedure ‘sp_primary_keys_rowset’. (SQLExecute[2812] at ext\pdo_odbc\odb
gbn
php sql-server-2005 datetime doctrine
I am using Doctrine 2.0 with php5.3 , being served from apache2 with a MSSQL\SQLEXPRESS 2005 backend.My problem is that when I go to insert a record with a DateTime object, I get the error.PDOException: SQLSTATE[22007]: [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting datetime from character string.As part of troubleshooting, I have verified that the target column is in fact of the type datetime. And I have echoed the query using the EchoLogger which return
Eric B.
xml eclipse validation xsd doctrine
I’ve got a PHP project in Eclipse with a lot of XML files. Right now, all my XML files are failing validation, with the following error message:White spaces are required between publicId and systemIdI’ve searched around, and publicId and systemId seem to be related to XML files that start with DOCTYPE. Mine don’t. Another SO posting indicated to add the XSD to the XML catalog in Eclipse, but that doesn’t seem to make a difference.One sample XML is the following:<?xml version=”1.0″ encoding
kamil
sql doctrine2 doctrine
I’m trying to do native SQL in Doctrine. Basically I have 2 parameters:CANDIDATE_ID – user for who we delete entries, list of FILE_ID to keepSo I make $this->getEntityManager()->getConnection()->executeUpdate( “DELETE FROM FILE WHERE CANDIDATE_ID = :ID AND NOT ID IN :KEEPID”,array(“ID” => $candidate->id,”KEEPID” => array(2) ));But Doctrine fails:Notice: Array to string conversion in D:\xampp\htdocs\azk\vendor\doctrine\dbal\lib\Doctrine\DBAL\Connection.php on line 786Is this bug
Clement Herreman
php symfony1 doctrine persistence many-to-many
Today I met some unexpected behavior on doctrine (1.2). SituationI’ve a Document class, and an Anomaly class. A Document can have many Anomalies, and an Anomaly can be found on many Documents.#schema.ymlDocument:columns:id: { type: integer(12), primary: true, autoincrement: true }scan_id: { type: integer(10), notnull: true }name: { type: string(100), notnull: true }Anomaly:columns:id: { type: integer(5), primary: true, autoincrement: true }label: { type: string(200) }value: { ty
user1987373
sql symfony2 doctrine doctrine2 dql
I have a Repository Class with a method to call a custom Query. When I try to call findAllWithRating() from inside a controller I got the following exception:[2/2] QueryException: [Syntax Error] line 0, col 156: Error: Unexpected ‘NULL’If I try to call the query within phpmyadmin the query works great! Any Idea?<?php namespace Anchorbrands\Bundle\MessageBundle\Entity;use Doctrine\ORM\EntityRepository;class MessageRepository extends EntityRepository {public function findAllWithRating() {return
k314
zend-framework doctrine
I got problem with Doctrine. I add this lines in my application.ini:includePaths.model = APPLICATION_PATH “/models”autoloaderNamespaces[] = “Doctrine”doctrine.dns = “mysql://root@localhost/translators” dectrine.data_fixtures_path = APPLICATION_PATH “/doctrine/data/fixtures” doctrine.models_path = APPLICATION_PATH “/models” doctrine.migrations_path = APPLICATION_PATH “/doctrine/migrations” doctrine.sql_path = APPLICATION_PATH “/doctrine/data/sql” doctrine.yaml_schema_path = “APPLICATION_PATH “/do
borrible
php doctrine
I am seeing an unexpected caching effect in Doctrine (1.2.4).I have a couple of related tables defined by the following YAML (several additional fields not used in the example removed). Just a simple 1-Many relationship from students to schools.School:tableName: tblschoolcolumns:sch_id:name: sch_id as idprimary: trueautoincrement: truetype: integer(4)sch_name:name: sch_name as nametype: string(50) Student:tableName: tblstudentcolumns:stu_id:name: stu_id as idprimary: trueautoincrement: truetype
Johannes Klauß
less symfony-2.1 assetic lessphp
I want to compile a LESS file with parameters fetched from the database.So something like this:$color = “#433332”;And then in .less@baseColor: $color;Of course this is just pseudocode, so give you an idea what I want to do.I am using Assetic, Symfony 2.1.8-DEV and the leafo/lessphp bundle.I have no idea how I could achieve this. Is it even possible?
j0k
symfony2 symfony-2.1 openshift
I’ve deployed my Symfony 2.1 application on openshift and it doesn’t work.Calling app.php server return 200 OK and a white page (in my local server work well).Log:=> php-5.3/logs/error_log-20130306-000000-EST <== [Tue Mar 05 19:16:00 2013] [error] [client 127.5.146.1] PHP 3. require_once()/var/lib/openshift/5e487f6c4a484700999d9213755b64eb/app-root/runtime/repo/php/app/bootstrap.php.cache:4[Tue Mar 05 19:16:00 2013] [error] [client 127.5.146.1] PHP 4.require()/var/lib/openshift/5e487f6c4a
Michi
php symfony2 symfony-2.1 assetic capifony
I’m stepping into deploying my Symfony app using Capifony. When Capifony executes assetic:dump I get a runtime Exception.[RuntimeException]Unable to write file{path}/releases/20130314071536/app/../web/js/.I tried executing the command manually and get the same Exception. Then I tried the command using the –verbose parameter and realized that all files with a source path that has a dot in it where written without the file name, only the extension. The Exception comes up when hitting a file name
user1041880
bundle symfony-2.1
I am using Symfony 2.1 and I want to add a new bundle. The bundle is called pulse00/ffmpeg-bundle this bundle is added to composer.json as any other bundle: in require array is added line “pulse00/ffmpeg-bundle”: “dev-master”After running php composer.phar update process ended with success. After that was bundle registered in appkernel.php.The problem begins with registering this bundle as service. In readme of this bundle is written: dubture_f_fmpeg:binary: /usr/bin/ffmpegBut Symfony crashes wi
user172409255
php doctrine2 symfony-2.1
I have around 40 entities and many bidirectional relationships. Whenever i use var_dump($user) or any entity my browser gets loaded with too much data of arrays and variables then it just crashed.i want to whats the problem.The data is being inserted fine. Can i cause issue in production.
Charles
php doctrine symfony-2.1 sonata-admin
I have been trying to setup Sonata Admin with Symfony-CMF for my project, and i have some errors when i trying to add menu item. How to fix this?Error:The class ‘Symfony\Cmf\Bundle\MenuBundle\Document\MenuItem’ was not found in the chain configured namespaces Doctrine\ODM\PHPCR\DocumentLogs:DEBUG – Notified event “kernel.request” to listener “Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelRequest”. DEBUG – Notified event “kernel.request” to listener “Symfony\Bundle\Framewo
DaveFX
php symfony2 doctrine2 symfony-2.1
I’m developing a bit complex Symfony2.1 based app, with connection to two different databases (with two entity managers, one connected to Oracle and the other one to PostgreSQL) and a custom User class (with a custom password encoder).I’ve managed to have it running correctly in dev environment, but whenever I try to run it in production environment I’m getting the next error:Doctrine\Common\Persistence\Mapping\MappingException: The class ‘MyFirm\UserManagerBundle\Entity\User’ was not found in t
tolgap
symfony2 doctrine doctrine2 symfony-2.1 jmsserializerbundle
I’m having this issue with JMSSerializerBundle. It basically gives me an exception for something that I’ve already done. This is my entity:Edited to avoid confusion about annotation lines<?phpnamespace My\ProjectBundle\Entity; use JMS\SerializerBundle\Annotation\Type;use Doctrine\ORM\Mapping as ORM;/*** My\ProjectBundle\Entity\Music* * @ORM\Table()* @ORM\Entity(repositoryClass=”My\ProjectBundle\Entity\MusicRepository”)*/ class Music extends Post { /*** @var integer $id* * @ORM\Column(name=”id
j0k
twig symfony-2.1
I have setup custom error pages to display for certain HTTP errors in the folder:app/Resources/TwigBundle/views/Exception/The 403 page (error403.html.twig) works and displays as expected.The 500 page (error500.html.twig) works and displays as expected.The 404 page (error404.html.twig) throws a 500 server error:PHP Fatal error: Uncaught exception ‘Symfony\Component\Routing\Exception\ResourceNotFoundException’The error is being thrown by doing an auth check to display certain menu items for users
icksde
php symfony2 symfony-2.1 apc xcache
Because a Bug in APC, i had to use another Cache-Drive. I removed APC and installed xcache. config.php says Your configuration looks good to run Symfony.I got the following error on request:PHP Fatal error: Uncaught exception ‘RuntimeException’ with message ‘Unable to use ApcClassLoader as APC is not enabled.’ in /var/…/app/bootstrap.php.cache:1039 Stack trace: #0 /var/…/web/app.php(11): Symfony\\Component\\ClassLoader\\ApcClassLoader->__construct(‘sf2’, Object(Composer\\Autoload\\ClassL
user1150508
symfony2 sonata-admin symfony-sonata
I have opened an issue here for my problem. The problem is basically that I can not show embed arrays or collections when listing, editing or adding user. When using SonataDoctrineORMAdminBundle there is no such problem. I could not find a good documentation to install SonataDoctrineMongoDBAdminBundle. How can I install SonataDoctrineMongoDBAdminBundle and use it without any crash?
Charles
php doctrine symfony-2.1 sonata-admin
I have been trying to setup Sonata Admin with Symfony-CMF for my project, and i have some errors when i trying to add menu item. How to fix this?Error:The class ‘Symfony\Cmf\Bundle\MenuBundle\Document\MenuItem’ was not found in the chain configured namespaces Doctrine\ODM\PHPCR\DocumentLogs:DEBUG – Notified event “kernel.request” to listener “Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelRequest”. DEBUG – Notified event “kernel.request” to listener “Symfony\Bundle\Framewo
likeitlikeit
symfony2 routing fosuserbundle symfony-sonata sonata-admin
I’ve followed the official doc to install the FOS User bundle for symfony 2, but at the very end, when I need to specify the routes :# app/config/routing.yml fos_user_security:resource: “@FOSUserBundle/Resources/config/routing/security.xml”fos_user_profile:resource: “@FOSUserBundle/Resources/config/routing/profile.xml”prefix: /profilefos_user_register:resource: “@FOSUserBundle/Resources/config/routing/registration.xml”prefix: /registerfos_user_resetting:resource: “@FOSUserBundle/Resources/config
RobMasters
php symfony2 sonata-admin
I’m hoping somebody will be able to shed some light on this problem – unfortunately I’m not able to provide too much to work from as I don’t know what’s going wrong.Basically, when I’m uploading JPEG images that are only about 300kb in size the page will hang and say something like “uploading 11%” in the status bar. Shortly afterwards, I’ll get the following CRITICAL error appearing in my logs:[2013-01-28 10:15:50] request.CRITICAL: Symfony\Component\HttpFoundation\File\Exception\FileNotFoundExc
stefun
validation symfony2 fosuserbundle sonata-admin
I’m implementing an application which needs CRUD functionality using SonataAdminBundle+SonatUserBundle+FOSUserbundle. Integration of bundle done successfully and login thing works fine. I manage to get change password form and resetting password form from FOSUserBundle. Now while submitting any of these form I’ll get error likeFatal error: Call to undefined method Symfony\Component\Validator\ExecutionContext::setCurrentProperty() in /vendor/symfony/src/Symfony/Component/Form/Extension/Validator/
deepak
php doctrine2 symfony-2.1 sonata-admin
I just upgraded my symfony2.1.6 to Symfony2.1.7 and bumped in to this issue. Please let me know I can provide more details. It was fine with 2.1.6 but does not seem to work in 2.1.7.This error comes when I try to access Customer.php Entity (customer listing)Notice: Undefined index: _per_page in /var/www/playground/vendor/sonata-project/admin-bundle/Sonata/AdminBundle/Admin/Admin.php line 720
puntotuning
symfony-2.1 fosuserbundle sonata-admin knpmenubundle
I’m following this tutorial http://tech.dupeu.pl/2012/10/getting-started-with-symfony-2-1-fosuserbundle-sonatauserbundle-and-sonataadminbundle/#respond to install the sonata admin bundle for symfony2.1(i’m currently using symfony2.1.7). Everything is working perfectly but when i click on the “List” button once logged in, i get a fatal error: Fatal error: Call to undefined method Knp\Menu\MenuItem::setCurrentUri() in /Users/salvatore/Documents/workspace/mysite/vendor/sonata-project/admin-bundle/S
Web site is in building