Forums / Install & configuration / ezOracle issue --allow-root-user parameter doesn't work when running script

ezOracle issue --allow-root-user parameter doesn't work when running script

Author Message

Ash P

Monday 31 January 2011 11:27:56 pm

I am following the Oracle installation README and am at the part where I am to run "ora-initialize.sh" to test the Oracle DB. The root user has all the needed ENV variables set correctly and the script fails at:

Testing PHPs Oracle support [ Success ]
Looking for eZ Publish installation [ Success ]
Testing eZOracle extensionRunning scripts as root may be dangerous.
If you think you know what you are doing, you can run this script with the
root account by appending the parameter --allow-root-user.

Appending "--allow-root-user" does nothing. Also tried "--php-exec=/usr/bin/php --allow-root-user" to no avail. Fine, so I "su oracle" and set all variables again. This time the script tells me that:

./ora-initialize.sh: line 185: /var/www/htdocs/extension/ezoracle/scripts/.ezoracle_test.php: Permission denied
Testing PHPs Oracle supportrm: cannot remove `/var/www/htdocs/extension/ezoracle/scripts/.ezoracle_test.php': No such file or directory
[ Failure ]
Your PHP installation does not have support for Oracle (OCI8)
compiled in and enabled.

Now I know that PHP has OCI8 support. I compiled it, it's being loaded in php.ini and I can connect to my local instance from php/apache.

I am very new to EzPublish (my first day in fact) and I'm not one to ask for help without exhausting available resources. My DB is already configured with tablespace/user. I just need to get past this step!

Thanks in advance for any help.

Gaetano Giunta

Tuesday 01 February 2011 9:55:28 am

Looks like you hit a bug. Can you file it in issues.ez.no?

The first error comes from the shell script not passing to the php scripts it generates the '--allow-root-user' param, which has been added in recent versions of eZP.

The second error comes from the oracle user not having enough permissions on the directory where you installed eZP. To fix it you should:

- either run chown -R oracle:oracle . on the eZP directory (after running initialize.sh you can chown back to www-data)

- or run the shell script with a user account that has both enough permissions to create/delete files and the proper oracle variables set up in his environment

Hope it helps

Gaetano (for the record: the maintainer of ezoracle)

ps: which version of ezoracle are you using?

Principal Consultant International Business
Member of the Community Project Board

Gaetano Giunta

Tuesday 01 February 2011 10:24:22 am

ps: I added a check for anough fs permissions for creating temp files in the latest svn version at http://svn.projects.ez.no/ezoracle/trunk/extension/ezoracle/bin/shell/ora-initialize.sh.

Can you please test?

Principal Consultant International Business
Member of the Community Project Board

Ash P

Tuesday 01 February 2011 6:02:19 pm

Thanks for your help Gaetano. So running the script (SVN) as user oracle, after chown -R on EZPUB directory I get:

$ ./ora-initialize.sh
Testing PHP [ Success ]
Testing Oracle installation
tnsnames.ora file: [ Success ]
The file tnsnames.ora has been found in /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin
LD_LIBRARY_PATH environment variable: [ Success ]
The environment variable $LD_LIBRARY_PATH is set to:
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib
If you are using an Oracle Instant Client install, make sure that
the environment variable LD_LIBRARY_PATH includes the directory
where the instant client has been installed
Testing PHPs Oracle support [ Success ]
Looking for eZ Publish installation [ Failure ]
No eZ Publish directory found
Please enter full eZ Publish path: /var/www/htdocs
Checking eZ Publish installation [ Success ]
Testing eZOracle extension [ Failure ]
eZOracle extension is present but not enabled

2 things here. First, the script didn't find the ez Pub path. It did in the original script. Second, I did attempt to enable the extension. The README states:

Enable the extension in eZ Publish. To do this edit site.ini.append(.php) in the folder root_of_ezpublish/settings/override. In the 4.3.0-full (also using exoracle version that comes with it) package there was no 'override' directory under settings/ so I created it and then placed the site.ini.. file in there.

# cat settings/override/site.ini.append.php
[ExtensionSettings]
ActiveExtensions[]=ezoracle

Then ran ezpgenerateautoloads.php as documented. I'll put in a bug report tonight.

Ash P

Tuesday 01 February 2011 9:44:19 pm

Issue #017904 has been created. Although based on the SVN script you may have already resolved it.

I'm not a very patient individual so I decided to give the Manual installation a try based on:

http://doc.ez.no/var/doc/storage/generated/database_extension_2_0.pdf -- I was able to successfully create the first 2 functions with (i.e.): sqlplus username/password@XE @extension/ezoracle/sql/{SQL file}

I'm at Creating a clean database and this is what I get:

# php bin/php/ezsqlinsertschema.php --allow-root-user --type=oracle --user=orc**** --password=pass*** share/db_schema.dba XE
With great power comes great responsibility.
You have 10 seconds to break the script (press Ctrl-C).
Could not initialize database:
* Tried database 'XE' locally with user 'orc*****' and with a password
* No database handler was found for 'oracle'

I found issue http://issues.ez.no/IssueView.php?Id=15109 and it shows a fix for this in 2.0.1 of the extension. I think I'm running 2.0.3 with eZP 4.3-full. The same error above occurs when using "--type=ezoracle".

So I read your suggestions here: http://projects.ez.no/ezoracle/forum/general/pb_using_script_ezsqlinsertschema_php_to_install_oracle_11g

I have (and I tried the generate with different modifications of this file - see above):

# cat settings/override/site.ini.append.php
<?php
[ExtensionSettings]
ActiveExtensions[]
ActiveExtensions[]=ezoracle
?>

# php ./bin/php/ezpgenerateautoloads.php
Scanning for PHP-files.
Scan complete. Found 266 PHP files.
Searching for classes (tokenizing).
Found 102 classes, added 102 of them to the autoload array.

# cat var/autoload/ezp_extension.php | grep -i oracle
'eZDBFileHandlerOracleBackend' => 'extension/ezoracle/clusterfilehandlers/dbbackends/oracle.php',
'eZDFSFileHandlerOracleBackend' => 'extension/ezoracle/clusterfilehandlers/dfsbackends/oracle.php',
'eZOracleDB' => 'extension/ezoracle/ezdb/dbms-drivers/ezoracledb.php',
'eZOracleSchema' => 'extension/ezoracle/ezdb/dbms-schema/ezoracleschema.php',
'ezoracleInfo' => 'extension/ezoracle/ezinfo.php',

I think all my problems stem from not having the extension enabled properly. What am I missing here?

Gaetano Giunta

Sunday 13 February 2011 6:48:49 am

The 1st installation method assumes that you have a working eZP installation before you try to migrate the database. To achieve that you have to run the setup wizard first. That will create the settings/override/site.ini.override.php file that you miss.

If this is not clear enough by reading the docs on http://doc.ez.no/Extensions/eZ-Publish-Extension-for-Oracle-R-database/2.0/Installation (point 1), please say so and we'll try to improve them.

As for the 2nd installation method ("manual"), I think I always tried it after having run the installation wizard anyway - the difference with the automatic method being mostly that the db is reinitialized and not migrated.

If I have time I might look into testing setup without going through the setup wizard, but since nobody ever does that for mysql, I think the best option would be to enable the setup wizard to run on oracle instead...

Principal Consultant International Business
Member of the Community Project Board

eZ debug

Timing: Jan 17 2025 23:58:49
Script start
Timing: Jan 17 2025 23:58:49
Module start 'content'
Timing: Jan 17 2025 23:58:49
Module end 'content'
Timing: Jan 17 2025 23:58:49
Script end

Main resources:

Total runtime0.7399 sec
Peak memory usage4,096.0000 KB
Database Queries204

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 589.5313180.7813
Module start 'content' 0.00530.6069 770.3125637.9844
Module end 'content' 0.61220.1276 1,408.2969345.3281
Script end 0.7398  1,753.6250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.5232210.0002
Check MTime0.00150.1983210.0001
Mysql Total
Database connection0.00090.119110.0009
Mysqli_queries0.641586.68932040.0031
Looping result0.00210.28812020.0000
Template Total0.715496.720.3577
Template load0.00210.280420.0010
Template processing0.713396.397520.3566
Template load and register function0.00020.024910.0002
states
state_id_array0.00090.123110.0009
state_identifier_array0.00150.200320.0007
Override
Cache load0.00200.27121270.0000
Sytem overhead
Fetch class attribute can translate value0.00140.190330.0005
Fetch class attribute name0.00110.153070.0002
XML
Image XML parsing0.00100.133130.0003
class_abstraction
Instantiating content class attribute0.00000.003190.0000
General
dbfile0.00580.7874270.0002
String conversion0.00000.000530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
16content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
29content/datatype/view/ezxmltags/emphasize.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/emphasize.tplEdit templateOverride template
30content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 88
 Number of unique templates used: 9

Time used to render debug report: 0.0002 secs