php,symfony2,symfony-2.1,apc,xcacheRelated issues-Collection of common programming errors


  • Danvin Lee Qicheng
    php html dynamic graph
    Currently I have a page where once you click that page it will fetch yahoo weather reading and supposedly it will be added to the graph (real time).Currently i have input a timer to consistly read from the page and now I can’t put it into the y value of the graph so may I request some time to take a look at my codes?P.S. line 309 is the input of y value, and line 280 is the timer that calls the file.index.php<script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js”><

  • ThihaKyaw
    php android mysql
    What is this error, and why does it happen? Please explain and solve. This is sample from “androidhive”. I need help for my thesis because of my thesis android app is to store data at web server.12-10 10:08:09.556: W/System.err(401): org.apache.http.conn.HttpHostConnectException: Connection to http://localhost refused 12-10 10:08:09.556: W/System.err(401): org.apache.http.conn.HttpHostConnectException: Connection to http://localhost refused 12-10 10:08:09.686: W/System.err(401): at org.apache.h

  • Muhammed Aslam C
    php google-app-engine curl google-api-php-client
    This works in WAMP server, i get output. but not in GAE. because GAE doesn’t support cURL. and i couldn’t find any solution to use GAPI php in GAE. Is there any way to use php GAPI in GAE? Here is the example filter code the provide<?php define(‘ga_email’,’[email protected]’); define(‘ga_password’,’your password’); define(‘ga_profile_id’,’your profile id’);require ‘gapi.class.php’;$ga = new gapi(ga_email,ga_password);$filter = ‘country == United States && browser == Firefox || bro

  • Xalu
    java php android mysql json
    I am currently working on an app and I am trying to implement a user system with login/registatration. I’ve been going over several tutorials to get an idea what to do. Now I am beginng to wonder if something is wrong with my eclipse enviroment because after trying 2 or 3 tutorials (and downloading the source code to test), I keep getting the same errors.Rather than posting all the code (there is a lot)…Here is a link to the projects tutorial http://www.learn2crack.com/2013/08/develop-android-

  • SPeed_FANat1c
    php random poker
    I have made a research on poker equities. What I did is use pokerstove program with some selected. And with that program calculated the equities using enumerate all method. So pokerstove results:I also made a table where I store the random results:CREATE TABLE poker_results ( id int NOT NULL AUTO_INCREMENT, matches_id int NOT NULL, — just for filtering in case I will want another starting hands. result varchar(255) NOT NULL, winner_hands varchar(255) NOT NULL, PRIMARY KEY (id) ) The result col

  • Darius
    php xml
    I call commission junction API and receive this as a response.$xml_response = simplexml_load_file($xml_response); exit($xml_response);If I do $xml = new SimpleXMLElement($xml_response);I get an application error. (Not sure how to find what error this is, where could I set error codes to show for this part?)Warning: simplexml_load_file(): I/O warning : failed to load external entity ” 106032782478435B & H Photo VideoComputers & Solutions > Laptops > MacBookshttp://www.jdoqocy.com/cl

  • Martijn Riemers
    php git maven vert.x
    I’m trying to install the PHP language in my vert.x mods directory. I have tried both branches and both process a different answer.All these results and errors were either produced when trying to build from the git repo or using running vertx run app.php in the command line using this simple PHP script:<?phpuse Vertx\Pump;$server = Vertx::createNetServer();$server->connectHandler(function($socket) {$pump = new Pump($socket, $socket);$pump->start(); })->listen(1234, ‘localhost’);When

  • jbihan
    java php android mysql json
    Immersed in the development of my program, I encounter an error that seems to me not really speaking.So here’s my logcat in the order and the java code:When I click on the item in my listview it should return me the contact information for the update.public class MajContactActivity extends Activity {EditText txtNom; EditText txtPrenom; EditText txtNummobile; EditText txtNumfixe; EditText txtEmail; EditText txtAdresse; EditText txtProfession;Button btnSav; Button btnSup;String idCONTACT;// Progr

  • mrkirby153
    java php sockets encryption
    Recently I was experimenting with communication between a webserver and java and ended up experimenting with sockets. Putting this into production, it is a must to encrypt the data being sent to and from the java socket server and to the php webserver. As an encryption method, I am using AES. I can get the PHP web server to successfully encrypt the data and send it via a socket but I cannot get the java application to successfully decrypt the message. I keep gettingException in thread “main” jav

  • Inator
    php javascript apache nosql couchdb
    I’ve recently successfully installed CouchDB version 1.2.1 and as a test I can access it using the following Apache rewrite in CentOS 6:RewriteRule couchdb/(.*)$ http://127.0.0.1:5984/$1 [QSA,P]I have a PHP authentication class that I use across a home grown API to support my mobile apps. My API accepts and authenticates each request using an HMAC signature that is included in the URL like so:https://api.domain.com/endpoint/?timestamp=[timestamp]&signature=[signature]&id=[id]…etcEach

  • j0k
    php symfony2 doctrine2
    I’m trying to do this in Symfony2 with Doctrine2 v. 2.1.7:$query = $this->em->createQuery(“SELECT aFROM “.$repo.” aWHERE a.type_id = :typeidAND a.scenario = :scenAND a.contact_id = :cidAND a.row_type LIKE :rwtpORDER BY SUBSTRING(a.row_type, 4, 1) “)->setParameters(array(‘typeid’ =>$sesData[‘type_id’],’scen’ =>$sesData[‘scenario’],’cid’ =>$sesData[‘contact_id’],’rwtp’ =>’%.’.$whereVal.’%’));$customValues = $query->getResult();Doctrine 2 fails on the OR

  • Juan Treminio
    symfony2 phpunit silex
    I’m creating an application in Silex with unit tests.Running unit tests works fine against the regular session handler:$app->register(new Silex\Provider\SessionServiceProvider(), array(‘session.storage.options’ => array(‘cookie_lifetime’ => 1209600, // 2 weeks), ));and setting this flag in my unit tests:$this->app[‘session.test’] = true;If I don’t set that session.test flag, my unit tests throw a headers already sent error and all fail. With it on, my tests run well.The issue is I am

  • carp-enter
    symfony2 mysqli
    I decide to work with Symfony for three weeks, realizing a small projekt to test. Inside a Controller I use MySQL native without Problems. Now I want to change to MySQLi and nothing runs.Connecting to the DB with: $mysqliName = new mysqli(‘localhost’, ‘user’, ‘psasswd,’, ‘database’);fails with:”Class ‘blabla\HaloBundle\Controller\mysqli’ not found in /Applications/MAM…/HaloController.php”I can run MySQL in a “normal” php, out of Symfony without problems. What must I do, that I can use the MySQ

  • jcroll
    php mysql symfony2 solr doctrine2
    Doing a Native SQL Query on a class table inheritance hierarchy is mentioned in the examples in the docs but I will produce the relevant example here:<?phpuse Doctrine\ORM\Query\ResultSetMapping;// Equivalent DQL query: “select u from User u where u.name=?1” // User is a mapped base class for other classes. User owns no associations. $rsm = new ResultSetMapping; $rsm->addEntityResult(‘User’, ‘u’); $rsm->addFieldResult(‘u’, ‘id’, ‘id’); $rsm->addFieldResult(‘u’, ‘name’, ‘name’); $rsm-

  • randak
    php mysql xml symfony2 propel
    The ProblemI am working on a new project using Symfony and am trying to set up the database in my local environment. I am using Symfony v. 2.3.7, PropelBundle 1.2.13 with Propel 1.7, Mac OS X 10.9, and PHP 5.4.17.What WorksI am able to create the database using propel:database:create and delete it using propel:database:drop. I can also use the SQL generated by propel:sql:build and directly insert it into the database, and then delete the tables using propel:tables:drop.What Doesn’tMy problem is

  • Bogdan
    symfony2 phpunit
    I’m trying to do some functional testing with PHPUnit but it requires that I add session.storage.filesystem for the storage_id option in config.yml. This causes the login process to fail, for some reason. I get the following error in test.log : Authentication request failed: Your session has timed-out, or you have disabled cookies. Afterwards I’m redirected to the login page again. I’m certain that I have cookies enabled and that the application works without setting that option(with native sess

  • Sgoettschkes
    unit-testing symfony2 phpunit
    I am trying to test my symfony2 application using PHPUnit. I got one project where everything works as expected, but on my other project I have this strange behaviour that PHPUnit either stops executing the Test Suite randomly near the end of all tests and restarts or restarts the tests after finishing the Test Suite and writing the code coverage. Other times it runs normally.Here is some output to make visible what is happening ( Test is restarting over and over):PHPUnit 3.6.10 by Sebastian Ber

  • Mirror
    php oop symfony2 doctrine2 object-oriented-database
    In my shopping cart object , i have the collection of productsNow when user adds or removes the products , i have two optionsEither delete all old products and persist with new products Iterate with new product collection and see if thats already there. If not there then delete that object. If not there the add itWhich is better way

  • Pez
    symfony2 doctrine2 doctrine
    I have a setup with three entities, as you can see by the schema below, Person and Project are joined in a many-to-many relationship by Role.The problem arises in a function I wrote that will grab the People related to a Project, and Projects related to a Person. In these cases, I get proxy objects from doctrine, as expected. However, I’m unable to access properties of these objects without running __load on them. Here’s a slice of the schema:class Person{/*** @ORM\OneToMany(targetEntity=”Role”,

  • hakre
    symfony2 php
    I am using symfony2 standard version, on linux mint 12.I created a symfony2 project 2 days and everything went well, i installed a wrong bundle and messed up the project so i decided to delete the Symfony folder, and reinstall symfony.And now, if i do php app/check.php i get the timezone error, although my timezone is set correctly, and the configuration page looks like thisi triedrm -rf app/cache/* rm -rf app/logs/*and i tried chmod -R 777 app/cache app/logscould not fix itEditphp bin/vendors i

  • Elnur Abdurrakhimov
    php symfony2 symfony-2.1 composer-php
    To install vendors for Symfony 2.1.0 I’m running php composer.phar install but it gives error during Generating autoload files.Error is:Warning: Unexpected character in input: ‘\’ (ASCII=92) state=1 in on line 26Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap handling the post-install-cmd event terminated with an exceptionIt works fine on localhost, but not on server. Not sure what the problem is with the php set up?EDIT:PHP is 5.3.13. I checked that beforehand.I

  • Patt
    symfony2 symfony-forms symfony-2.1
    I am posting a form with Ajax.I have a surprising response when binding a form within an Ajax call:public function newCartAjaxAction(Request $request) {$form = $this->container->get(‘new_cart_form.factory’)->create();$formHandler = $this->container->get(‘new_cart_form.handler’);if (‘POST’ === $request->getMethod()){$form->bind($request);if ($form->isValid()){$formHandler->processValidForm($form);$response = new Response();$response->headers->set(‘Content-type’, ‘

  • EdwardBloom
    php ajax symfony2 symfony-2.1 logout
    I have a strange issue on Symfony 2.1.7. If an user clicks to quickly on different actions, this user is kickout (logout+redirect to homepage).Exemple of steps to issue: The user is on his account default page. He have a list of blog’s posts for example. The user clicks on a tab, wait until the browser is start loading then quickly he clicks on any blog’s post in the list. The user is logout. (The problem is here, if the user click quickly in any different actions…)Do you know if Symfony have

  • 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

  • Soroush Falahati
    php linux apache2 apc xcache
    First I had xCache installed on server, I had xCache on lot of my servers but in this one after couple of days you go nothing except a blank page with this error in apache error log:child pid XXXXX exit signal Segmentation faultAs far as I know this mean some sort of memory corruption.So I removed xCache from php.ini and installed APC. But things are worse now. After one hour or less/more server become unresponsive. I can clearly see in my website’s server-status that there are lot of connection

  • Palantir
    php zend-framework caching apc
    I am doing some experiments with APCu user data caching in PHP 5.5 through Zend Cache from ZF1, and Apache virtual hosts (with plain vanilla mod-php) and I am getting some unexpected results.What happens is that data added to the cache from one virtual host become available for reading and writing to other virtual hosts.I have added a cache prefix for each site and therefore resolved the immediate issue, but I would have expected more isolation between different virtual hosts. Is this the expect

  • Frank Farmer
    php performance apc
    Question pretty much states it all, I am working on a large project where most calls to php include() between 100 and 150 files. On average the time php takes is between 150 and 300 ms. I’m wondering how much of this is due to including PHP scripts? I’ve been thinking about running a script that checks most accessed files for particular calls and merge them into one file to speed things up, but for all I know this has zero impact. I should note that I use APC, I’m not fully aware of what APC doe

  • hakre
    php performance apc
    I have a question about Symfony2 performance.I have been developing with Symfony2 under Ubuntu 11.04 for a few weeks now, Apache 2.2.17, PHP 5.3.5, APC 3.1.9, no xDebugOn the dev environment, the time given on the Symfony2 toolbar was never above 70 ms.Today, I’ve tried to install my app on a Windows 7 environment : Wampserver 2.2, PHP 5.3.8, Apache 2.2.21, APC 3.1.7, no xDebugThe computer on the windows environment is much better than the one on ubuntu (SSD, Quad core, etc).And when I run the a

  • alehro
    .net winforms multithreading synchronization apc
    I have a bug. In WinForm .NET2.0 application my HeavyFunction can be called from mouse click event handlers. So, When I’m starting fast clicking I have crash on file writing because of HeavyFunction entered second time.My solution. I remembered the things relative to APC and decided to synchronize the things fairly. I.e. I want to exclude APC effects in the HeavyFunction. So, I used ThreadPool. For synchronization I tried to use SyncLock (Visual Basic). And failed. Mutexes don’t work either. I

  • akira
    php apc
    I wonder if anyone has found any weird behaviours with apc_exists(), behaviour that causes the entire WAMP server to hang when using it together with apc_add() or apc_store()? After a long session of “debugging” and minimizing the problem I ended up with the following code that causes my WAMP to crash.As far as I can tell it requires 1 apc_exists() and 2 apc_add() accessing different keys. [thus it sounds like a deadlock-issue] I run this script in chrome and then smashes F5-key until I get the

  • GreatestSwordsman
    wordpress apc opcode opcode-cache fragment-caching
    here is a link to how my APC is running : [removed]As you can see, it fills up pretty quickly and my Cache Full Count goes over 1000 sometimesMy website uses WordPress.I notice that every time I make a new post or edit a post, 2 things happen. 1) APC Memory “USED” resets 2) I get a whole lot of FragmentsI’ve tried giving more Memory to APC (512 mb) but then it crashes sometimes, it seems 384 is best. I also have a Cron job that restarts apache, clearing all APC of fragments and used memory, ever

  • Ledgemonkey
    php apc whm
    I’ve installed the APC extension on a Dedicated server – admin using WHM ,the extension is enabled but I can find a file to edit the basic settings – if I try and add anything other than extension=apc.so to the php.ini file the site crashes..?I’ve ran ~find . -name apc.ini but does not find a file.. Any ideas thanks

  • Charles
    php codeigniter apc
    I’m trying to use APC (Alternative PHP Cache) on my localhost with wamp 2, PHP 5.3 and CodeIgniter 1.7.2, however If I turn on cache_by_default and enable apc.stat the server will crash and I get the following error:[apc-error] Cannot redeclare classci_benchmark inC:\wamp\www\k\mvc\codeigniter\Common.phpon line 127.What can I do to fix this issue?

  • Stick it to THE MAN
    php windows-xp apc
    Trying to locate the correct APC DLL for my windows machine. All I have tried so far, causes Apache to crash. Short of compiling from the sources (which I dont really want to do), I seem to have come to a dead end.Details are:OS: XP PHP: php-5.2.11-win32-vc6

  • Soroush Falahati
    php linux apache2 apc xcache
    First I had xCache installed on server, I had xCache on lot of my servers but in this one after couple of days you go nothing except a blank page with this error in apache error log:child pid XXXXX exit signal Segmentation faultAs far as I know this mean some sort of memory corruption.So I removed xCache from php.ini and installed APC. But things are worse now. After one hour or less/more server become unresponsive. I can clearly see in my website’s server-status that there are lot of connection

  • Smoky McPot
    php xcache
    so i have 64-bit apache with 64-bit php running on 64-bit windows.i’d like to use xcache php extension. but there is only 32-bit version.can i use that 32-bit xcache with 64-bit php? they are both TS VC11 compiled, the only difference is the bit width.and, if it is possible, won’t there be any possible crashes because of this difference? like when php pushes a 64-bit integer to xcache -> xcache crashes.. or is there some bit-width transformation between these two?

  • 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

  • Alex
    php xcache
    How do I install the XCache extension on Windows + WAMP + PHP 5.3 ?I copied the extension dll in the extensions directory, and added the line in php.ini, then activated it trough the WAMP interface.The extension appears to be active, but I still get this error 😐

  • Alex C
    caching memcached apc xcache
    At work, we’ve recently started designing an application to me “large scale” (we’re engineering for the potential to serve up many millions of hits a day). One of the senior devs and the sysadmin have set up memcache on the server. As I understand it, Memcache will hold query results and certain tables in memory for X amount of time and keep everything hunky dory.A drawback of memcache it seems is that I just can’t for the life of me manage to set it up on my local dev environment. I’ve follo

  • Screenack
    php apache shared-hosting opcode xcache
    I’d like to install xcache on a shared hosting account. I’ve followed the instructions here: http://xcache.lighttpd.net/wiki/InstallFromSource but note the differences:You can not run “su” on a shared host, since the make install wants to move the xcache.* files to a shared module directory. You can, however, copy the xcache.* files into a directory on your account and tell php.ini to use that libraryThe problem I’m having is the following php error:[30-Jan-2013 04:35:52 America/Denver] PHP Warn

  • Charles
    php xcache zend-optimizer
    i have installed xCache and Zend optimizer in same time and it gives me PHP Fatal error: [Zend Optimizer] Zend Optimizer 3.3.3 is incompatible with XCache 1.2.1 in Unknown on line 0I have lines in installation document that i should include zend php.ini file to normal php.ini and ansure that xCache runs befor Zend Optimizer.My question is how i include files in php.ini and how i can be sure that xCache run before Zend Optimizer?

Web site is in building

I discovery a place to host code、demo、 blog and websites.
Site access is fast but not money