Forums / Install & configuration / question about updateniceurls.php

question about updateniceurls.php

Author Message

Shaun Ellis

Wednesday 08 October 2003 8:16:01 am

I saw in a post that I might need to run this script if I'm using nice url's:

update/common/scripts/updateniceurls.php

What exactly does this script do? Is it necessary? I can't find it anywhere in the documentation, only via the forum.

Thanks,
Shaun

Jan Borsodi

Thursday 09 October 2003 5:26:46 am

It goes trough all your objects and creates url aliases for them (or nice urls if you like).
It's necessary if you have an existing database and has upgraded to 3.1 or 3.2, running it is pretty safe too, it only modifies the alias table.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Shaun Ellis

Thursday 09 October 2003 11:17:55 am

Jan,
Thanks for the info. I was unable to run the script from the command prompt (due to my php compilation). I figured that I would try running it from the web browser since it was just updating the ezurlalias table. Unfortunately, this produced a bunch of errors because it couldn't open the include files.

Afterwards, everything on my public site stayed the same, while all the links on the admin site were updated with nice URLs. However, the admin links are missing the site URI. So what should have been a link to http://www.mysite.com/admin/folder is now a link to http://www.mysite.com/folder, and this is preventing me from using the admin site. Should I talk to my system administrator about recompiling php and then rerun the script from the command line? Do you think this will solve my problem?

-Shaun

Paul Borgermans

Thursday 09 October 2003 11:23:01 am

Yes,

Make sure you have the command-line version of php. You must be in the root of the ez publish server to run the script, not in the script directory itself (to have all those includes found).

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Kai Duebbert

Thursday 09 October 2003 7:55:50 pm

updateniceurls.php doesn't work at the moment. See bug report: http://www.ez.no/developer/ez_publish_3/bug_reports/updateniceurlsphp_doesnt_work_or_bug_in_ezobjecttreenodephp for a work around.

Also, it only sets the "path_identification", but doesn't change the url aliases (which is annoying in some circumstances). I haven't figured out how to do that best yet, but I'm working on it.

Kai

Shaun Ellis

Friday 10 October 2003 7:56:15 am

Ok, I'm a little confused and here's why:

Running the script from the browser actually seemed to work (sort of). Apparently the public site was cached, so it is now rendering nice URLs just like the admin site. By "sort of" I mean that the URIs strings are still missing from the end of the root url in the links, but everything else is ok.

I also got those errors when I ran it. But since it seemed to work, what are the negative effects of the scripts failing to load or even the "eZURLAlias" function call bug that Kai speaks of? How does it prevent nice URLs from working correctly?

My final site will use HOST for site access, but I currently have to use URI for development. I'll try to work on restoring the URIs and repost when I figure it out. Anyone out there have success with nice URLs when using URI for site access?

-Shaun

Jan Borsodi

Thursday 16 October 2003 1:44:53 am

The script has been fixed in 3.2-2, I would recommend copying the script from the new version (or upgrade, even better) and run it again.

If the script fails all that happens is that you can't use nice urls (e.g. developer/ez_publish_3), all other aspects of your site will work.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Shaun Ellis

Tuesday 18 November 2003 7:44:11 am

Unfortunately, one of the main reasons I chose eZpubish was because our competitors had implemented content management systems with unruly URL's and we wanted to avoid that. Turning off URL aliasing is not an option for our live site. Also, strangely, ever since I ran the updateniceurls.php script I've been unable to access my admin site even after I turned off url aliasing.

I have tried everything. I have installed the php binary and tried running the most recent updateniceurls.php script from the command line. I got errors regarding the includes... so then I figured I'd use absolute paths when including the class files. Below you can see the errors I get... it looks like it's trying to use relative paths for accessing other includes, but it's obviously not working. I guess I could go through and change all the relatives to absolutes, but is there an easier way to do this?:
-----------------------
<b>Warning</b>: Failed opening 'lib/ezutils/classes/ezini.php' for inclusion (i
nclude_path='.:/u1/sdellis/phpbinary/lib/php') in <b>/u1/sdellis/apache/htdocs/e
zpublish-3.2-1/lib/ezutils/classes/ezextension.php</b> on line <b>46</b><br />
<br />
<b>Warning</b>: Failed opening 'lib/ezutils/classes/ezdebug.php' for inclusion
(include_path='.:usr/phpbinary/lib/php') in <b>usr/apache/htdocs
/ezpublish-3.2-1/lib/ezutils/classes/ezmodule.php</b> on line <b>44</b><br />
<br />
<b>Warning</b>: Failed opening 'lib/ezutils/classes/ezini.php' for inclusion (i
nclude_path='.:usr/phpbinary/lib/php') in <b>usr/apache/htdocs/e
zpublish-3.2-1/lib/ezutils/classes/ezcli.php</b> on line <b>59</b><br />
<br />
<b>Warning</b>: Failed opening 'lib/ezutils/classes/ezdebug.php' for inclusion
(include_path='.:usr/phpbinary/lib/php') in <b>usr/apache/htdocs
/ezpublish-3.2-1/lib/ezutils/classes/ezcli.php</b> on line <b>60</b><br />
<br />
<b>Warning</b>: Failed opening 'lib/ezutils/classes/ezdebugsetting.php' for inc
lusion (include_path='.:usr/phpbinary/lib/php') in <b>usr/apache
/htdocs/ezpublish-3.2-1/lib/ezutils/classes/ezcli.php</b> on line <b>61</b><br /
>
<br />
<b>Warning</b>: Failed opening 'lib/ezutils/classes/ezcli.php' for inclusion (i
nclude_path='.:usr/phpbinary/lib/php') in <b>usr/apache/htdocs/e
zpublish-3.2-1/kernel/classes/ezscript.php</b> on line <b>78</b><br />
<br />
<b>Warning</b>: Failed opening 'lib/ezdb/classes/ezdb.php' for inclusion (inclu
de_path='.:usr/phpbinary/lib/php') in <b>usr/apache/htdocs/ezpub
lish-3.2-1/kernel/classes/ezscript.php</b> on line <b>79</b><br />
<br />
<b>Fatal error</b>: Undefined class name 'ezdebug' in <b>usr/apache/htd
ocs/ezpublish-3.2-1/kernel/classes/ezscript.php</b> on line <b>120</b><br />
----------------

Can anyone offer any advice before I do a complete re-install?

-Shaun

Paul Borgermans

Tuesday 18 November 2003 12:22:00 pm

Did you run the command in the base directory of your ez publish install?

cd <base dir ezp>
php -C update/common/scripts/updateniceurls.php

Did you install/compile a second version of php along the existing one (not there if you use the bundled install of apache+php+ezp)?

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Shaun Ellis

Wednesday 19 November 2003 8:13:36 am

Yes, I did both of those.

Paul Borgermans

Wednesday 19 November 2003 8:24:54 am

Then you should find the php.ini (if it exists, if not create it for your second php install wherever the compiler defaults think it should be)

Look if the include_path includes the current directory:

include_path = "./: and so on "

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Shaun Ellis

Wednesday 19 November 2003 1:45:47 pm

Paul,
The include_path is commented out by default in the php.ini file. I currently don't have permission to edit this file, so I may need to recompile with the "--with-config-file-path=/myDir" directive to put this in a directory I can work in. Your advice looks promising... I'll keep you posted.

Thanks,
Shaun

Shaun Ellis

Tuesday 25 November 2003 7:56:26 am

I finally got the include_path set to ".:/php/includes" in the php.ini file for the php binary I installed. Then I ran the scripts from the ezPub root dir. Unfortunately, the includes still couldn't be opened.

Thanks for all the advice, but I think I'm just going to have to reinstall from scratch. Good thing I didn't enter too much content yet!