I tried both ZF 1.12.0 and 2.0.3, then ran this code:
On my computer it didn't work and seemed to stuck in this line:
$videoEntry = $yt->newVideoEntry();
I know that because when I put two echos around that line, only the first got displayed.
The weird thing is that there is no such method called newVideoEntry() anywhere, at all.
And the most annoying thing is that it works completely fine on phpcloud, which turn out to be using ZF 1.11.11, an old version that I can't find anywhere on the internet.
I'm really lost. Any idea? Which version I should use, since they are so much different and incompatible. Any solution for that code ?
Method newVideoEntry() does not exist because it is a magical method. Zend_Gdata_App::__call takes care of that. It creates Zend_Gdata_YouTube_VideoEntry and things go on.
if you want to use the same library as phpcloud all you have to do is to pull the content of the zf library that is hosted on the php cloud server. dont remember where it is exactly but should be in a zend folder on the phpcloud server.
As for the error you get , without the exact error message it is hard to tell what's wrong.
Related
I saw many different questions here, but nothing was helpful to me.
I have no trouble with an interpreter, I tried to reset PhpStorm's cache.
It looks like file functions.php isn't accessible.
I really don't want to make a total reset. Maybe somebody has an idea how to solve it?
I'm not sure what I actually did and how to reproduce this issue again, but now it works well. I took previous version of PHPstorm. When I installed new one, the previous one was simply renamed to sth like 'phpstorm2'.
Here are my thoughts what actually happened:
As I understand for highlighting is responsible that part of application which is managed under Languages & Frameworks / PHP / PHP Runtime.
To reproduce this issue you may try to disable there "Core / Core" and try to write down in any place of your phpfile following:
\Exception::class();
And in your case this class will not be highlighted, as it presents in Core_c.php. In my case it is placed in
/opt/phpstorm/plugins/php/lib/php.jar!/stubs/Core/Core_c.php
I'm 100% sure that these libs were always enabled, but why I didn't saw this - that is the question.
So if I face this issue again my steps would be:
Try to verify Languages & Frameworks / PHP / PHP Runtime. The better way would be to enable ALL libs.
Check External Libraries in the project tree. Check read privileges for /opt/phpstorm/plugins/php/lib/php.jar and probably reinstall this plugin.
Try to find out function which I don't actually see in External Libraries.
m having a strange problem never faced it before and tried every thing and i mean everything but no luck at all.
What happened was i downloaded the application source code built on joomla 1.7 via ftp from the live server and deployed it on my localhost and configured it correctly. Now what happened is it displaying some sort of raw data all over the browser window, attached is the screenshot.
Please guys its been 5 days since i stuck in this mess any help will be highly appreciated
Thanks in advance
Maybe you have installed an extension, which supports distribution of PHP code as binary code? There exist different extensions to PHP, which support this kind of functionality. Probably the most widespread is Zend Guard. To execute a script which was encrypted by this software your PHP needs to load the free loader extension provided by Zend. If your server has loaded this extension and your localhost does not, the output might be something like you encounter.
Your first step should be to compare the output of phpinfo of both servers. If Zend Guard (or a similar extension) is loaded on your production server and not on your localhost, this might be the problem. Next step should involve taking a look at the PHP files and search for one which contains lots of unreadable characters. If this seems unreasonable to you, you might as well just install Zend Loader and see if it works then, which might be less work.
Oke, i've been busting my head on this one.
I'm gonna try and keep things short, however, if you need more info, don't hesitate to ask.
I've written an import repo for an external firm, so we can import their data into our service.
quick overview of implemented logic?
ftp, grab xml file, parse it with simple_xml and do db stuff using laravel eloquent component.
on my dev machine,
every run gets parsed fully and all data is inserted correctly into the database.
problem
when i try the same thing on my production server.
I'm receiving a duplicate entry error, always on the same exact record. (unless i'm using another file)
pre script setup to help detect the error
on each run i do the following:
make sure i'm using the exact same files on both dev and prod
environment... (i've disabled the ftpgrab and uploaded manually to
the correct location)
truncate all the related tables so i'm always
starting with empty! tables.
i've manually triple-zillion checked for duplicates in the xml, but they're not in there.... and the fact that
my dev machine parses the file correctly confirms this.
what i tried
at this point, i've got no more clues as to how i'm supposed to debug this properly.
by now, i've checked so many things (most of them i can't even remember), all of which seemed pretty unrelated to me, but i had to try them.
those things include:
automatic disconnects due to browser
mysql wait timeouts
php script timeouts
memory settings
none of them seem to help (which was exactly what i was expecting)
another fact
my php version on my dev is 5.4.4 and the version on the production server is 5.3.2 (i know this is bad practise, but i'm not using any new features, it's really dead easy code, though it has quite a few lines :-) )
i've been suspecting this to be the cause, but
i've now switched to 5.3.14 on my dev... still the import runs without an issue
the changes from 5.3.2 to 5.3.14 are probably pretty minor
i've tried to manually compile the exact same php version, but i'm to inexperienced to properly do this. moreover, it probably wouldn't have the exact same specs anyway (i think it's pretty impossibly to ./configure exactly the same, considering the use of MacOs vs Ubuntu? especially for a noob like me)
So i've abandoned this path.
I've tried to find the differences in the php versions, but i can't seem to stumble upon anything that might be the cause to all this.
there was a change related to non-numeric keys in arrays (or strings for that matter) in version 5.4.4 (i think) but since i've now come to the conclusion that 5.3.14 also works, this definitely is not the issue. --- looking around insecurely hoping not having said anything downright stupid ---
quick thought while writing this:
the thing is, even though i'm getting the duplicate error statement.
The record did get inserted into the database.
moreover, the error gets triggered when having processed about 2700 (of total 6000) records.
the bound data to the query is actually the data of the second record in the xml file.)
I'm sincerely hoping anyone could put me on the right track for this issue :(
If you made it this far, but don't have a clue about what's going on, thx for reading and sticking to it.
If you might have clue, please enlighten me!
I was asked to help getting a website that was running with 5.2 php code, to work on a 5.3 php server. The site is big, and I can't see the errors that would appear normally when a site isn't working.
I've tried to use the Search and replace function that Dream Weaver has, and simply use it all over the website. But the problem is that I only want to replace functions in PHP documents, and not in js files. When i use Search and replace, in Dreamweaver, it overwrites the js files aswell, and that would cause more errors. Because there's A LOT of files that i have to go through, it would take me a lot of time if i had to go through it manually.
I figured this must be a problem that a lot of firms experiance, so there must be ways to handle this without it being a bigger hassle.
Anybody out there who could help me out ? Any help is much appreciated!
Regards,
Mathias
Check out the official guide about Migrating from PHP 5.2.x to PHP 5.3.x
most existing PHP 5 code should work without changes, but make sure error-reporting is enabled to get some idea of what is going wrong .
I would recommend the use of sed from command line. It is most likely the fastest and most powerful find/replace utility available for LAMP developers.
http://www.grymoire.com/Unix/Sed.html
Dont worry about it! If your code works in php->5 for the most part it will work just fine. 5.3 offers a plethora of options but no doubt your not using them.
Recently I started using NetBeans 6.7 beta for PHP development instead of Textmate and MacGDBp. I am rather amazed with it's feature set and most everything worked out of the box, or was easily configured to my liking.
I am having an issue with the code completion features though; they work for built-in functions, SPL and some of my code, but not all of my code, specifically, it never works for any methods in my classes, regardless of PHPDoc comments.
I can't seem to find any decent questions, let alone answers about this specific subject anywhere. It looks like everybody else who has problems with the code completion just hasn't enabled the auto-popup feature.
So the big question is:
Is there any way to influence the code completion cache, or something I have to add to my code to make it work? I'd really like to have code completion for the methods I write.
PS: I have tried several older versions of netbeans, they all exhibit the same problem.
edit: I've put a .zip up of my current test project. get it here. It's a very young project, think a day and a half.
edit2: Below is a screenshot of what i'm looking at. As you can see, it fails to complete pretty much anything, nor does it see the PHPDoc documentation.
I've tried opening your project, and the completion seems to be working just fine for me.
The only thing I can think of is to try to delete your entire NB cache, which should be located in $HOME/.netbeans/$VERSION/var/cache/. This is a wild guess
Create a backup first, I didn't try this!
If that fails, maybe you should try creating a new project, maybe that will kick NB in the butt.
Note that in NB 7.2 beta, the cache has moved to $HOME/.cache/netbeans/$VERSION.
What worked for me was deleting the old nbproject folder (that was created in windows) and recreating the PHP project from existing sources. This is on NB 7.0.1 Mac OS X. Clearing the cache did not work for me.
Be aware of #property something syntax. If object something does not exists in your code anymore, NetBeans might have problems with proper code completion. Consider example:
/** in main file: **/
use ABC as _ ;
/** in file ABC: **/
/**
* #property \Something $something
*/
If you do not use $something anymore, NetBeans will most likely generate an exception, thus failing to complete the code.
What worked for me was clearing the cache, then explicitly including some key subdirectories in the Global include path. Appears that for some reason NB 6.7 wasn't recursing the directories.
Including at project level also worked
Project->Properties->Include Path
Netbeans 7.01 + Windows 7
If, for instance, you open a php file with netbeans without being part of a project, code completion doesn't work at all. What you need to do is to create a project having that file in it.
Tested this on NetBeans 7.0.1