I am well aware of the existence of the maintenance script generateSitemap.php. I got a unique multi-language wiki setup though. That is i guess why it does not really work.
So after i do php -f generateSitemap.php i get this error:
PHP Warning: file_get_contents(/var/www/mySite/_inc/../.ENVIRONMENT): failed to open stream: No such file or directory in /var/www/mySite/_inc/settings.inc.php on line 12
PHP Notice: Undefined index: HTTP_HOST in /var/www/mySite/wiki/LocalSettings.php on line 174
<br />
<b>Notice</b>: Undefined index: HTTP_HOST in <b>/var/www/mySite/wiki/LocalSettings.php</b> on line <b>174</b><br />
DB connection error: Connection refused (127.0.0.1:8889)
I got ONE single LocalSettings.php and only ONE database using prefixes. It changes depending on the user language like or what he/she selects so:
de.mySite.org
en.mySite.org
es.mySite.org
and so forth.
How can i run my maintenance script and get my sitemap? Any ideas are welcome.
Edit:
I tried setting different parameters as shown here. I did not get it right yet.
Edit2:
I plan to use a Cron to update sitemap automatically via a bash command.
Related
I have 2 modules that uses Plugins for Magento\Framework\App\State::afterSetAreaCode
Whenever both of the modules are enabled Magento throws:
1 exception(s):
Exception #0 (Exception): Notice: Undefined index:
Magento\Framework\App\State in /vendor/magento/framework/Interception/PluginList/PluginList.php on line 250
I've followed the code and came to conclusion that the fault seems to be a Magento\NewRelicReporting\Plugin\StatePlugin::afterSetAreaCode. This modules and method is calling retrieving some configuration values.
Somehow, retrieving the values load additional configuration files and resets Magento\Framework\Interception\PluginList\PluginList::_pluginInstances list which then returns error when next plugin in List in Magento\Framework\Interception\Interceptor tries to call getPlugin method.
This seems to happen only when cache is clear, once it's populated the site seems to work, but obviously it's not going to work correctly.
Has anyone ever encountered such issues?
A Magento extension I installed has a line of code that leads into a fatal error.
I'm using Magento 1.8.0 and when I remove this line everything works like expected.
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
Can somebody please explain what this line of code does and why its needed in the extension.
After I commented this line out everything works fine and I couldn't find any kind of problem, but I'm a bit scarred that the problem will come up later.
Here is what the system log file throws:
2014-08-27T21:10:13+00:00 ERR (3): Warning: include(Mage/Default/Helper/Data.php): failed to open stream: No such file or directory in /homepages/11/d460572798/htdocs/magento/lib/Varien/Autoload.php on line 93
2014-08-27T21:10:13+00:00 ERR (3): Warning: include(): Failed opening 'Mage/Default/Helper/Data.php' for inclusion (include_path='/homepages/11/d460572798/htdocs/magento/app/code/local:/homepages/11/d460572798/htdocs/magento/app/code/community:/homepages/11/d460572798/htdocs/magento/app/code/core:/homepages/11/d460572798/htdocs/magento/lib:.:/usr/lib/php5.4') in /homepages/11/d460572798/htdocs/magento/lib/Varien/Autoload.php on line 93
I'm a complete newbie in programming of Magento.
The code is use to set current store that using by Magento
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
Magento uses store with id zero for admin side. Frontend may have any number of stores. So they don't have fixed store id. But admin side always has its store id zero and is fixed.
So the extension, due to some reason trying to use admin store forcefully. May be that line added in the extension during the development of the extension (for testing purpose). But not sure.
From the question, it is not sure where that code is using. So I cant say whether the code is essential or not. But if the problem solves when comment out that line and if there is no log errors present, you are good to go. Feel free to comment out that line.
The error that is showing in log errors are showing due to this line (A wild guess).
If you need more details, you need to ask this quesition to developers who created that extesnion :)
I just copied my htdocs folder to anther pc with a clean new xampp and made a copy of the database too. When i try to access the site the php error log shows this error:
[13-Jun-2014 18:34:07 Europe/Berlin] PHP Warning: array_merge() [http://php.net/function.array-merge'>function.array-merge]: Argument #1 is not an array in C:\xampp\htdocs\website\View\Helper\MenuHelper.php on line 74
[13-Jun-2014 18:34:07 Europe/Berlin] PHP Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\website\View\Helper\MenuHelper.php on line 85
My other page which was in the same htdocs folder is running fine (it isn't using cakephp). Any ideas what could have happened? Any idea how to find out where this is called since it seems to be a cakephp-Helper?
EDIT:
Seems I missed 2 lines in the php_error.log:
PHP Notice: Undefined variable: login in C:\xampp\htdocs\website\View\Layouts\default.ctp on line 2
PHP Notice: Undefined variable: menu in C:\xampp\htdocs\website\View\Layouts\default.ctp on line 82
some see me the same, that's what I did, just copy the folder app, after creates a new project and copy the app folder and replaces the app folder. and shuld be found. I look the reason of the problem and just read about the cookies and cache. And the option that a give you is more easy.
The problem was that I was using a new version of xampp but did not update cakephp to the newest version. After doing so everything worked fine.
I have googled this to the edge of my ability and the current results don't seem to apply to me.
A couple days ago, the admin made some changes to the system, and the script I had to run nightly stopped working. When I would attempt to run the script I would get the following:
PHP Warning: mysql_connect(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in /Path/UpdateDB.php on line 2
PHP Warning: mysql_connect(): No such file or directory in /Path/UpdateDB.php on line 2
PHP Warning: mysql_select_db(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in /Path/UpdateDB.php on line 3
PHP Warning: mysql_select_db(): No such file or directory in /Path/UpdateDB.php on line 3
PHP Warning: mysql_select_db(): A link to the server could not be established in /Path/UpdateDB.php on line 3
No connection.
I contacted the admin and she said that she made some changes. When I ran that script this morning I just got the failure messages that I set up that are giving me this error:
MySQL error Data truncated for column 'GameID' at row 1
Now I checked all the other that were talking about the tables being strict and having my data be too large, but GameID is an int and the largest value that I have is 1737690.
At one point I set the failure to echo my statement, and then manually tried to run that in phpmyadmin and it worked. So that makes me believe it's something with the path it's trying to use.
EDIT: This is the email from the admin:
Some updates were done last break. OSX has php installed at /usr/bin/php. We installed a local php at /usr/local/bin/php and configured it to work with mysql. You you need to ensure you use php at /usr/local/bin/php.
I have restored your crontab file. I also added a MAILTO and PATH. All are commented out for now. If you uncomment the UpdateDB.php you should also uncomment the MAILTO and PATH. MAILTO will send any output to your email address. PATH will ensure that /usr/local/bin/php is used instead of /usr/bin/php.
#MAILTO=evan.lepolt#gmail.com
#PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/usr/local/mysql/bin
#0 * * * * cd ~/Path; php UpdateDB.php;
I have updated the PATH you get when you SSH to ucfilespace.uc.edu. So it now has /usr/local/bin first so /usr/local/bin/php will be used instead of /usr/bin/php if you use php command.
/usr/local/bin/php has the mysql socket defined as /tmp/mysql.sock. So you script should now work via cron and at command line also.
I have a PHP script which reads from an xml file to generate a table. The first thing it does is check to make sure the file exists.
$path = getcwd();
if(file_exists($path.'\inc\php\kbs.xml')){
$kbs = simplexml_load_file($path.'\inc\php\kbs.xml');
} else {
echo "Error: No KB file found";
}
For some reason, intermittently, it doesn't find the file. I've tried removing the file_exists check all together (since I know the file does exist) but it still doesn't load the file at times. I can refresh the page and 7 times out of 10 it doesn't load, but sometimes it does.
I never ran into this problem during development, but once it went production (being used by maybe 200 users now) it started happening.
How do I go about troubleshooting this? (PHP 5.2.14 running on IIS)
EDIT: Error logs give me the following messages when it fails:
Notice: Undefined variable: kbs in <the path> on line 16
Notice: Trying to get property of non-object in <the path> on line 16
Warning: Invalid argument supplied for foreach() in <the path> on line 16
line 16 is the first time the variable $kbs is accessed. Obviously $kbs isn't set if the file isn't found.
Please use the absolute path, relative path make things a mess.
Is the location relative to PHP? Do permissions allow the web server to see it?