Zend Framework - sometimes strange errors in few environments - php

I have project written in Zend Framework and it works fine most of environments.
For example it works good in Windows 7 and Windows XP with popular browsers such as IE, Firefox, Opera and Google Chrome.
In my computer it also works on Ubuntu, but in my friend's computer on ubuntu sometimes it doesn't.
For example: it worked fine yesterday morning, but later it didn't load and there was this error:
Zend_Session::start() - /var/www/try/library/Zend/Loader.php(Line:146):
Error #2 Zend_Loader::include_once() [function.include]: Failed opening 'Req.php' for
inclusion (include_path='.:/var/www/try/application/../library:/var/www/try
/application/../lib:/var/www/try/application/models/:/var/www/try
/application/models/generated/:/var/www/try/application/controllers/:/var
/www/try/application/forms/:.:/usr/share/php') Array
Sometimes even css isn't loaded...
It's like $this->configuration['baseUrl'] suddenly don't work.
What it could be?
Restarting the browser usually helps.

What happened?
An include failed when the application tried to load 'Req.php'
This appears to be that the classes are not autoloading correctly.
What to check?
Check you have the required libraries installed correctly, and matching the folders on your include path. i.e. run a search in your project for Req.php, check this actually exists.
Check where your include path is set - try wrapping the following line in a realpath(), the environment may not like the '../library' in the path.
/var/www/try/application/../library

The answer is that, there was some a problem with session, and the application looked for files from another application, which was used before (application was in the same server).
I found the answer accidently, when I was doing something in that other application and I found there the Req.php file...

Related

PHP 5.5 -> 5.6: Include not working any more (Codeigniter)

I´m moving an application from a PHP 5.5 server to a PHP 5.6 server. The application is based on Codeigniter 2.2.
On the old server I had something like this in my views to include other template parts:
include('header.php');
This simple and direct include works like a charm on the old server.
On the new server I get the exception, that the file for inclusion could not be found.
I found out, that the PHP preprocessor tries to grab the file from the linux include paths and also from the "system/core" directory. But not from the directory where the view itself is located.
I´ve not idea what makes the difference between these two systems... Has anybody an idea where I can search for the issue?
Check the file path. Whether its inside some other folder or not.
Also can try with
$this->load->view('header.php');
or can load header in Controller as well
As well there are some useful keyword.
APPPATH - Outputs application path. Ex application/
Thanks guys for all your input - I´ve already tried most of these debugging attempts.
Now I digged a little deeper and found the reason for my problems. The short_open_tag directive in PHP caused the issue. Cause this new server had some slight differences in php.ini.
In core/loader.php Codeigniter tries to replace short open tags with normal tags, if the .ini setting for short_open_tags is disabled. For any reason this replacement isn´t working as expected and that caused my issues.
So if anyone has the same issue after moving a Codeigniter installation from one machine to another, that might be a point where you can start.
Thanks to all of you,
Michael

Does Aptana Studio change/format files during deploy? Getting 500 error without changes

Using Aptana Studio 3. Does anyone know if Aptana Studio formats or changes files when it does an "auto deploy"?
Didn't make any changes to files while I ported over a Wordpress site to Aptana Studio. When I set up an SFTP connection and enabled auto deploy, it did what looked like a sync and suddenly the server crashed with a 500 error.
PHP Fatal error: Call to undefined function get_header()
Given the error above, it looks like Aptana deleted something. Is there a local history like IntelliJ?
I'm hoping someone can explain if Aptana formats files or deletes them when it does a sync.
Thanks.
Aptana won't delete anything during a sync...but it does do a "safe" upload. It uploads the new file to a temporary file on the server, deletes the original file, and then renames the new one to the old one. The main reason this fails is if there is a mismatch in server permissions such that it can't perform the rename or delete. Fixing those permissions fixes the issue.
As to Local History...try this: http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2FgettingStarted%2Fqs-55.htm
I found a very strange result after the Aptana "auto deploy". Essentially, all of the files in the folder under editing were copied and overwritten to the root.
Given the circumstances it looks like an Aptana bug. I double-checked connection settings and folders were set correctly. Perhaps a sign to abandon Aptana.

Dreamweaver CS5.5 Dynamically Related Files

I'm trying to use Dreamweaver with an existing code base (not WP, Drupal, or Joomla!) in a PHP/MySQL site. I continue to receive "Dynamically related files could not be found because of an internal server error." I've been googling all day and have read plenty of WP-specific solutions, including the thread on this site. I've tried all the methods listed, no luck.
Setup Info
MAMP 2.0.1
Mac OS X 10.6.8
Dreamweaver CS 5.5
Site's local address: /Users/myName/Sites/siteName
Testing server address: /Applications/MAMP/htdocs/siteName
Attempted solutions:
1) added library to site root (/Users/myName/Sites/siteName/library)
2) added library to MAMP root (/Applications/MAMP/library)
3) added include path for both locations to applied php.ini listed in phpinfo
4) set Dreamweaver to use Site Root paths instead of page-relative paths
5) switched back to page relative paths
6) Restart MAMP, reset ports in Preferences to 8888/8889, or 80/3306
7) checked site info to make sure paths are correctly defined
When I insert the following code, or any require function with a relative path, live view and preview in browser display empty pages.
<?php require_once('includes/initialize.php'); ?>
I'm incredibly frustrated. I had been using XAMPP and a plain text editor for previous work and never had an issue with relative paths. Any help would be appreciated.
Answering my own question; bad form, I'm aware.
EDIT:
Adding to previous list of attempted solutions:
8) tried designating the server ports as 8888/8889 and defining server route as http://localhost:8889/mySite/, like setting up a Drupal/WP/Joomla! testing environment.
9) Uninstalled/Reinstalled MAMP, Dreamweaver, disabled the out-of-the-box Apache server included with OS X, the redefined the site in Dreamweaver.
Fix attempt 8 led to packet error discussed here. Fix attempt 9, plus error reporting that hadn't been working, but did now:
// Report all PHP errors (see changelog)
error_reporting(E_ALL);
showed that the testing server was using the local definition to refer to dynamically related files and, even though that should work, it wasn't working.
After reinstall, created new site with "Site > Manage Sites" and defined Local Site Folder in "Site" menu and the Server Folder in the "Server" Menu as the same directory. (/Applications/MAMP/htdocs/mySite)
Refer to the Setup info in the OP to see my system variables; this may be specific to any/all settings. But only identical local definition and server definition solved the problem. I've recreated previous settings to be sure, and different local/server definitions don't work.
This error can happen with Dreamweaver and PHP sites if the contents of the included file make additional dynamic calls using PHP syntax that Dreamweaver doesn't recognize. Without seeing the contents of initialize.php, I can't be 100% sure this is the case but I am pretty sure that DW is not able to parse the code there and figure out what files to get for display.
Problem Dynamically related files that I see a lot of people run into:
Dreamweaver is scanning whatever is in you Local Copy, it should be a the full installation of WordPress. If you're working locally, download everything on your "Testing server" to your "Local view" in the Files panel.
If you're working with two sets of files, your local copy and what is in MAMP's htdocs or on your "Testing server" should be nearly identical, except for what you're working on of coarse. That's the problem I see people have.
If you're working in kind of "pho-FTP" environment.

Symfony project is not work on local pc

I have this trouble: i copy symfony project files on my pc, after that change paths and db settings, and it still not working, even dont tell about errors! Maybe there is some specific actions for setting up symhony on another server?
Almost the same problem How to configure symfony project in local server? but when i try execute "php symfony" it prints "no such file or directory"
There are no any php errors at all.
Using Fedora 15 OS, and apache. php work in command line, symfony is not working. I tried to find out what is happening - inside Controller.class some error, when it use processObjects method, it take 11 objects, and after first of them (header.object.php) it stops.
The white screen generally means symfony can't write to cache and/or log dir, check on apache error logs to see details.
if 'php symfony' on command line throws no such file or directory could mean php is not in your system path.
Please add more information to get answers
myabe, as said below is a permission problem of the caché and log files. Check if they are writable. Good Luck!

Apache doesn't execute my copied PHP files, but testing.php works

I've just installed LAMP on my Ubuntu 9.10 machine, and everything works fine except when I copy my PHP files from another computer.
The LAMP guides I've followed also made me create a phpinfo() test file, which works, but when I try to type in e.g. index.php absolutely nothing happens - just a blank page in FireFox. :(
The files are in the exact same directory.
I'm thinking it's probably something with permissions and so on, but since I'm new to both PHP and Ubuntu, I'm kind of lost. It's like I can't create a PHP file with my file browser, but only by using the terminal - like when I created the testing.php from the LAMP guide.
Whaddayaknow... I made an error, tried to:
echo "Hello" world
which, even though I'm a PHP noob, I clearly know is wrong.
I think I'll have to figure out how to enable some sort of error reporting, a blank page is clearly not good enough.
You mean you have a index.php (copied from another computer) and a test.php (edited by hand, with a call to phpinfo()) in the same apache directory, the second works from your browser and the first doesnt ?
That can be a permission issue, or some compilation error in your php.
About permissions, for files should be readable from the apache server (more precisely, form the user that runs the apache server). You can type chmod a+r index.php.
YOu can also check your apache error logs (location dependent on installation). In any case it's vital to know where the error logs are if your are developing a web site.

Categories